diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2018-09-26 19:29:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-26 19:56:07 +0300 |
commit | 4fda33547676e270245431d59aa72f3e5bdc1d30 (patch) | |
tree | 0472d464653965d27d1129f5c42fe5b9a94ad3b2 /drivers/s390/net/qeth_core_sys.c | |
parent | 4b1bd69769454175268908f50b32f1cbfee5bb83 (diff) | |
download | linux-4fda33547676e270245431d59aa72f3e5bdc1d30.tar.xz |
s390/qeth: convert layer attribute to enum
While the raw values are fixed due to their use in a sysfs attribute,
we can still use the proper QETH_DISCIPLINE_* enum within the driver.
Also move the initialization into qeth_set_initial_options(), along with
all other user-configurable fields.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_sys.c')
-rw-r--r-- | drivers/s390/net/qeth_core_sys.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 25d0be25bcb3..fdb67af811f4 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -228,7 +228,7 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev, card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS; card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; } else if (sysfs_streq(buf, "prio_queueing_vlan")) { - if (!card->options.layer2) { + if (IS_LAYER3(card)) { rc = -ENOTSUPP; goto out; } @@ -379,7 +379,7 @@ static ssize_t qeth_dev_layer2_show(struct device *dev, if (!card) return -EINVAL; - return sprintf(buf, "%i\n", card->options.layer2); + return sprintf(buf, "%i\n", card->options.layer); } static ssize_t qeth_dev_layer2_store(struct device *dev, @@ -413,7 +413,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, goto out; } - if (card->options.layer2 == newdis) + if (card->options.layer == newdis) goto out; if (card->info.layer_enforced) { /* fixed layer, can't switch */ @@ -432,7 +432,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, card->discipline->remove(card->gdev); qeth_core_free_discipline(card); - card->options.layer2 = -1; + card->options.layer = QETH_DISCIPLINE_UNDETERMINED; free_netdev(card->dev); card->dev = ndev; |