From: Oliver Neukum <oneukum@suse.com>
To: Kristian Evensen <kristian.evensen@gmail.com>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] cdc_ether: Improve ZTE MF823/831/910 handling
Date: Mon, 18 Jul 2016 15:01:26 +0200 [thread overview]
Message-ID: <1468846886.2280.6.camel@suse.com> (raw)
In-Reply-To: <1468844691-8222-1-git-send-email-kristian.evensen@gmail.com>
On Mon, 2016-07-18 at 14:24 +0200, Kristian Evensen wrote:
> The firmware in the ZTE MF823/831/910 modems/mifis use OS fingerprinting to
> determine which type of device to export. In addition, these devices export
> a REST API which can also be used to control the type of device. So far, on
> Linux, the devices have been seen as RNDIS or CDC Ether.
>
> When CDC Ether is used, devices of the same type are, as with RNDIS,
> exported with the same, bogus random MAC address. In addition, the devices
Please explain. If the MAC is random, I fail to see why the host would
be any better at making up a MAC.
> (at least on all firmware revisions I have found) use this MAC when sending
> traffic routed from external networks. And as a final feature, the devices
> sometimes export the link state incorrectly.
>
> This patch tries to improve the handling of these devices by doing the
> following:
>
> * If a random MAC is read from device, then generate a new random MAC
> address. This fix will apply to all devices using cdc_ether, but that
> should be ok as we will also fix similar mistakes from other
> manufacturers.
I am not really happy with this.
If this is specific to the device a quirk should be used. If it is a
truly generic misdesign, it does not belong into cdc-ether. It should go
into the generic layer.
> * The MF823/MF832/MF910 sometimes export cdc carrier on twice on connect
> (the correct behavior is off then on). Work around this by manually setting
> carrier to off if an on-notification is received and the NOCARRIER-bit is
> not set.
>
> This change will also affect all devices, but as with the MAC-fix it should
> take care of similar mistakes. I tried to think of/look/test for
> problems/regressions that could be introduced by this behavior, but could
> not find any. However, my familiarity with this code path is not that
> great, so there could be something I have overlooked.
Looks OK
> * Add an rx_fixup-function (and a new driver info-struct) which is used by
> these three devices (identified either as PID 0x1405 or 0x1408). The
> rx_fixup-function replaces the destination MAC address in the skb with that
> of the device. I have not seen a revision of these three device that
> behaves correctly (i.e., sets the right destination MAC), so I chose not to
> do any comparison with for example the known, bogus addresses.
Looks OK
Regards
Oliver
next prev parent reply other threads:[~2016-07-18 13:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 12:24 [PATCH net-next] cdc_ether: Improve ZTE MF823/831/910 handling Kristian Evensen
2016-07-18 13:01 ` Oliver Neukum [this message]
2016-07-18 13:23 ` Kristian Evensen
2016-07-18 13:50 ` Oliver Neukum
2016-07-18 14:10 ` Kristian Evensen
[not found] ` <CAKfDRXjaSz25_b8Na46DJEDvGUsZ-Xye+Rn2+o6Hy0EcuOopkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-18 14:14 ` Oliver Neukum
2016-07-18 14:27 ` Kristian Evensen
[not found] ` <1468851242.2280.14.camel-IBi9RG/b67k@public.gmane.org>
2016-07-18 15:04 ` Kristian Evensen
[not found] ` <CAKfDRXiK82ULw7RnRGdFwzad8NOfnwZN0vqv=08Tf+cNSdyd2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-19 6:20 ` Oliver Neukum
2016-07-19 6:40 ` Kristian Evensen
2016-07-19 7:17 ` Oliver Neukum
2016-07-19 8:30 ` Lars Melin
2016-07-19 11:06 ` Kristian Evensen
2016-08-08 12:44 ` Bjørn Mork
2016-08-08 13:57 ` Oliver Neukum
2016-08-08 18:30 ` Bjørn Mork
[not found] ` <87oa535d10.fsf-3F4PFWf5pNjpjLOzFPqGjWGXanvQGlWp@public.gmane.org>
2016-08-18 8:03 ` Oliver Neukum
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=1468846886.2280.6.camel@suse.com \
--to=oneukum@suse.com \
--cc=kristian.evensen@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).