diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2019-08-20 16:46:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-20 13:51:46 -0700 |
commit | 59b757a9bf2bd30173029fa7bd6821239d6a7242 (patch) | |
tree | 2080255f2c57e4d4df6ae53a544ac94b6865d061 /drivers/s390/net/qeth_core_main.c | |
parent | s390/qeth: get vnicc sub-cmd type from reply data (diff) | |
download | linux-dev-59b757a9bf2bd30173029fa7bd6821239d6a7242.tar.xz linux-dev-59b757a9bf2bd30173029fa7bd6821239d6a7242.zip |
s390/qeth: streamline control code for promisc mode
We have logic to determine the desired promisc mode in _each_ code path.
Change things around so that there is a clean split between
(a) high-level code that selects the new mode, and (b) implementations
of the various mechanisms to program this mode.
This also keeps qeth_promisc_to_bridge() from polluting the debug logs
on each RX modeset.
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 '')
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 95996ce99145..44fbaa4f7264 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -4015,23 +4015,14 @@ static int qeth_setadp_promisc_mode_cb(struct qeth_card *card, return (cmd->hdr.return_code) ? -EIO : 0; } -void qeth_setadp_promisc_mode(struct qeth_card *card) +void qeth_setadp_promisc_mode(struct qeth_card *card, bool enable) { - enum qeth_ipa_promisc_modes mode; - struct net_device *dev = card->dev; + enum qeth_ipa_promisc_modes mode = enable ? SET_PROMISC_MODE_ON : + SET_PROMISC_MODE_OFF; struct qeth_cmd_buffer *iob; struct qeth_ipa_cmd *cmd; QETH_CARD_TEXT(card, 4, "setprom"); - - if (((dev->flags & IFF_PROMISC) && - (card->info.promisc_mode == SET_PROMISC_MODE_ON)) || - (!(dev->flags & IFF_PROMISC) && - (card->info.promisc_mode == SET_PROMISC_MODE_OFF))) - return; - mode = SET_PROMISC_MODE_OFF; - if (dev->flags & IFF_PROMISC) - mode = SET_PROMISC_MODE_ON; QETH_CARD_TEXT_(card, 4, "mode:%x", mode); iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_PROMISC_MODE, |