mirror of https://gitee.com/openkylin/linux.git
s390/qeth: clean up setting of BLKT defaults
When called from qeth_core_probe_device(), qeth_determine_capabilities() initializes the device's BLKT defaults. From all other callers, the ccw_device has already been set online and the BLKT setting is skipped. Clean this up by extracting the BLKT setting into a separate helper that gets called from the right place. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7cbc9e8fe6
commit
09ac887f03
|
@ -665,6 +665,7 @@ struct qeth_card_info {
|
||||||
__u16 func_level;
|
__u16 func_level;
|
||||||
char mcl_level[QETH_MCL_LENGTH + 1];
|
char mcl_level[QETH_MCL_LENGTH + 1];
|
||||||
u8 open_when_online:1;
|
u8 open_when_online:1;
|
||||||
|
u8 use_v1_blkt:1;
|
||||||
u8 is_vm_nic:1;
|
u8 is_vm_nic:1;
|
||||||
int mac_bits;
|
int mac_bits;
|
||||||
enum qeth_card_types type;
|
enum qeth_card_types type;
|
||||||
|
|
|
@ -1633,6 +1633,8 @@ static void qeth_configure_unitaddr(struct qeth_card *card, char *prcd)
|
||||||
card->info.cula = prcd[63];
|
card->info.cula = prcd[63];
|
||||||
card->info.is_vm_nic = ((prcd[0x10] == _ascebc['V']) &&
|
card->info.is_vm_nic = ((prcd[0x10] == _ascebc['V']) &&
|
||||||
(prcd[0x11] == _ascebc['M']));
|
(prcd[0x11] == _ascebc['M']));
|
||||||
|
card->info.use_v1_blkt = prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
|
||||||
|
prcd[76] >= 0xF1 && prcd[76] <= 0xF4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum qeth_discipline_id qeth_vm_detect_layer(struct qeth_card *card)
|
static enum qeth_discipline_id qeth_vm_detect_layer(struct qeth_card *card)
|
||||||
|
@ -1716,12 +1718,11 @@ static enum qeth_discipline_id qeth_enforce_discipline(struct qeth_card *card)
|
||||||
return disc;
|
return disc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
|
static void qeth_set_blkt_defaults(struct qeth_card *card)
|
||||||
{
|
{
|
||||||
QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
|
QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
|
||||||
|
|
||||||
if (prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
|
if (card->info.use_v1_blkt) {
|
||||||
prcd[76] >= 0xF1 && prcd[76] <= 0xF4) {
|
|
||||||
card->info.blkt.time_total = 0;
|
card->info.blkt.time_total = 0;
|
||||||
card->info.blkt.inter_packet = 0;
|
card->info.blkt.inter_packet = 0;
|
||||||
card->info.blkt.inter_packet_jumbo = 0;
|
card->info.blkt.inter_packet_jumbo = 0;
|
||||||
|
@ -4761,8 +4762,6 @@ static void qeth_determine_capabilities(struct qeth_card *card)
|
||||||
goto out_offline;
|
goto out_offline;
|
||||||
}
|
}
|
||||||
qeth_configure_unitaddr(card, prcd);
|
qeth_configure_unitaddr(card, prcd);
|
||||||
if (ddev_offline)
|
|
||||||
qeth_configure_blkt_default(card, prcd);
|
|
||||||
kfree(prcd);
|
kfree(prcd);
|
||||||
|
|
||||||
rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
|
rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
|
||||||
|
@ -5660,6 +5659,8 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
|
||||||
if (rc)
|
if (rc)
|
||||||
goto err_chp_desc;
|
goto err_chp_desc;
|
||||||
qeth_determine_capabilities(card);
|
qeth_determine_capabilities(card);
|
||||||
|
qeth_set_blkt_defaults(card);
|
||||||
|
|
||||||
enforced_disc = qeth_enforce_discipline(card);
|
enforced_disc = qeth_enforce_discipline(card);
|
||||||
switch (enforced_disc) {
|
switch (enforced_disc) {
|
||||||
case QETH_DISCIPLINE_UNDETERMINED:
|
case QETH_DISCIPLINE_UNDETERMINED:
|
||||||
|
|
Loading…
Reference in New Issue