Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux