diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-01-25 18:52:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-26 17:20:32 +0300 |
commit | 8ca769e2b88f9e564aecdfab54fcc5a9d20190c1 (patch) | |
tree | aa9c1737d4bbd2bc6a0f44149b74958a2dc370d9 /drivers/s390/net/qeth_l2_main.c | |
parent | 14a1d2468ab370c8f02d341b1551bc742a8975d3 (diff) | |
download | linux-8ca769e2b88f9e564aecdfab54fcc5a9d20190c1.tar.xz |
s390/qeth: shift some bridgeport code around
qeth_l2_setup_bridgeport_attrs() is entirely unrelated to sysfs
functionality, move it where it belongs.
While at it merge all the bridgeport-specific code in the set-online
path together.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l2_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 7175b5d8a23c..7da306e267c9 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -728,6 +728,24 @@ static void qeth_l2_trace_features(struct qeth_card *card) sizeof(card->options.vnicc.sup_chars)); } +static void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card) +{ + if (!card->options.sbp.reflect_promisc && + card->options.sbp.role != QETH_SBP_ROLE_NONE) { + /* Conditional to avoid spurious error messages */ + qeth_bridgeport_setrole(card, card->options.sbp.role); + /* Let the callback function refresh the stored role value. */ + qeth_bridgeport_query_ports(card, &card->options.sbp.role, + NULL); + } + if (card->options.sbp.hostnotification) { + if (qeth_bridgeport_an_set(card, 1)) + card->options.sbp.hostnotification = 0; + } else { + qeth_bridgeport_an_set(card, 0); + } +} + static int qeth_l2_set_online(struct ccwgroup_device *gdev) { struct qeth_card *card = dev_get_drvdata(&gdev->dev); @@ -748,9 +766,11 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) mutex_lock(&card->sbp_lock); qeth_bridgeport_query_support(card); - if (card->options.sbp.supported_funcs) + if (card->options.sbp.supported_funcs) { + qeth_l2_setup_bridgeport_attrs(card); dev_info(&card->gdev->dev, - "The device represents a Bridge Capable Port\n"); + "The device represents a Bridge Capable Port\n"); + } mutex_unlock(&card->sbp_lock); qeth_l2_register_dev_addr(card); @@ -761,8 +781,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) qeth_trace_features(card); qeth_l2_trace_features(card); - qeth_l2_setup_bridgeport_attrs(card); - card->state = CARD_STATE_HARDSETUP; qeth_print_status_message(card); |