From: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>
To: <linux-usb@vger.kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Stefan Brüns" <stefan.bruens@rwth-aachen.de>
Subject: [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs
Date: Tue, 7 Feb 2017 03:33:17 +0100 [thread overview]
Message-ID: <cbb609c5c4154e5ca463edc5aa390bd6@rwthex-w2-b.rwth-ad.de> (raw)
In-Reply-To: <20170207023317.29192-1-stefan.bruens@rwth-aachen.de>
When the context is deactivated, the link_type is set to 0xff, which
triggers a warning message, and results in a wrong link status, as
the LSI is ignored.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
drivers/net/usb/sierra_net.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 977afe74ed54..e9e14263ff0a 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -385,6 +385,13 @@ static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
return -1;
}
+ /* Validate the session state */
+ if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
+ netdev_err(dev->net, "Session idle, 0x%02x\n",
+ lsi->session_state);
+ return 0;
+ }
+
/* Validate the protocol - only support UMTS for now */
if (lsi->protocol == SIERRA_NET_PROTOCOL_UMTS) {
struct lsi_umts_single *single = (struct lsi_umts_single *)lsi;
@@ -418,13 +425,6 @@ static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
return 0;
}
- /* Validate the session state */
- if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
- netdev_err(dev->net, "Session idle, 0x%02x\n",
- lsi->session_state);
- return 0;
- }
-
/* Set link_sense true */
return 1;
}
--
2.11.0
next prev parent reply other threads:[~2017-02-07 2:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170207023317.29192-1-stefan.bruens@rwth-aachen.de>
2017-02-07 2:33 ` [PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications Stefan Brüns
2017-02-07 18:53 ` David Miller
2017-02-07 18:55 ` David Miller
2017-02-08 3:39 ` kbuild test robot
2017-02-07 2:33 ` Stefan Brüns [this message]
2017-02-07 18:53 ` [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cbb609c5c4154e5ca463edc5aa390bd6@rwthex-w2-b.rwth-ad.de \
--to=stefan.bruens@rwth-aachen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®