From: Gaston Gonzalez <gascoar@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: devel@driverdev.osuosl.org, arnd@arndb.de,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
joe@perches.com, navyasri.tech@gmail.com
Subject: Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning
Date: Thu, 07 May 2015 00:09:34 -0300 [thread overview]
Message-ID: <554AD76E.7060605@gmail.com> (raw)
In-Reply-To: <20150427101242.GR14154@mwanda>
On 27/04/15 07:12, Dan Carpenter wrote:
> Can't we just export the tkip.c function?
>
> regards,
> dan carpenter
>
Hi Dan,
(sorry for the delayed response)
The inputs of the two implementations of tkip_mixing_phase2() differ in
one parameter:
- ieee80211_crypt_tkip.c expects 'const u16 *TTAK'
- tkip.c expects 'struct tkip_ctx *ctx'
tkip_mixing_phase2() is called two times in ieee80211_crypt_tkip.c:
git grep tkip_mixing_phase2 drivers/staging/rtl8192u/ieee80211/
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:static void
tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:
tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16);
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:
tkip_mixing_phase2(rc4key, tkey->key, tkey->rx_ttak, iv16);
tkey is a 'struct ieee80211_tkip_data', which differs from tkip_ctx
structure. So in the case of exporting the tkip.c function, we would
need to add 'struct tkip_ctx' definition, and not just change the
function input definition.
The only member of tkip_ctx structure used in tkip_mixing_phase2() is
p1k, which is the equivalent of TTAK array in ieee80211_crypt_tkip.c .
Thus - I'm new to this so I may be missing something - one way would be
to just add the tkip_ctx structure definition in ieee80211_crypt_tkip.c.
The down side of doing this is that there would be some parameters
defined twice in two different structures: u32 iv32, u16 iv16, u16
p1k[5], u32 p1k_iv32
Another way would be split ieee80211_tkip_data structure in struct
tkip_ctx on one side, and leave the rest of the members on the original
structure. This would avoid to duplicate the members definitions, but I
guess that approach could broke other things...
As I said, I'm new to this so I may be missing something, maybe a
different approach?
One detail: although not used in the function, 'enum
ieee80211_internal_tkip_state state' is not defined in 'struct
ieee80211_tkip_data', thus in any case that definition would have to be
added.
regards,
Gaston
prev parent reply other threads:[~2015-05-07 3:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-19 20:43 [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning Gaston Gonzalez
2015-04-20 8:24 ` Dan Carpenter
2015-04-25 22:44 ` Gaston Gonzalez
2015-04-27 10:12 ` Dan Carpenter
2015-05-07 3:09 ` Gaston Gonzalez [this message]
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=554AD76E.7060605@gmail.com \
--to=gascoar@gmail.com \
--cc=arnd@arndb.de \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=navyasri.tech@gmail.com \
/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