From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
Alex Elder <elder@linaro.org>, David Miller <davem@davemloft.net>,
Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include
Date: Tue, 21 May 2019 14:08:04 -0700 [thread overview]
Message-ID: <20190521210804.GR31438@minitux> (raw)
In-Reply-To: <CAK8P3a0JpCnV59uWmrot7KeLPCOq_FqPb--xD_fMpaPd7x0zRg@mail.gmail.com>
On Tue 21 May 13:45 PDT 2019, Arnd Bergmann wrote:
> On Tue, May 21, 2019 at 9:35 PM Subash Abhinov Kasiviswanathan
> <subashab@codeaurora.org> wrote:
> >
> > Create if_rmnet.h and move the rmnet MAP packet structs to this
> > common include file. To account for portability, add little and
> > big endian bitfield definitions similar to the ip & tcp headers.
> >
> > The definitions in the headers can now be re-used by the
> > upcoming ipa driver series as well as qmi_wwan.
> >
> > Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
> > ---
> > This patch is an alternate implementation of the series posted by Elder.
> > This eliminates the changes needed in the rmnet packet parsing
> > while maintaining portability.
> > ---
>
> I think I'd just duplicate the structure definitions then, to avoid having
> the bitfield definitions in a common header and using them in the new
> driver.
>
Doing would allow each driver to represent the bits as suitable, at the
cost of some duplication and confusion. Confusion, because it doesn't
resolve the question of what the right bit order actually is.
Subash stated yesterday that bit 0 is "CD", which in the current struct
is represented as the 8th bit, while Alex's patch changes the definition
so that this bit is the lsb. I.e. I read Subash answer as confirming
that patch 1/8 from Alex is correct.
Subash, as we're not addressing individual bits in this machine, so
given a pointer map_hdr to a struct rmnet_map_header, which of the
following ways would give you the correct value of pad_len:
u8 p = *(char*)map_hdr;
pad_len = p & 0x3f;
or:
u8 p = *(char*)map_hdr;
pad_len = p >> 2;
PS. I do prefer the two drivers share the definition of these
structures...
Regards,
Bjorn
next prev parent reply other threads:[~2019-05-21 21:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 19:35 [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include Subash Abhinov Kasiviswanathan
2019-05-21 20:45 ` Arnd Bergmann
2019-05-21 21:08 ` Bjorn Andersson [this message]
2019-05-21 21:50 ` Alex Elder
2019-05-22 5:47 ` Subash Abhinov Kasiviswanathan
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=20190521210804.GR31438@minitux \
--to=bjorn.andersson@linaro.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=elder@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.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).