* [PATCH] rndis_wlan: set cipher suites for cfg80211
@ 2009-08-26 12:53 Jussi Kivilinna
2009-08-26 13:21 ` Holger Schurig
0 siblings, 1 reply; 4+ messages in thread
From: Jussi Kivilinna @ 2009-08-26 12:53 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
rndis_wlan does not set cipher suites list for cfg80211 which causes
wext-compat-range to report rndis_wlan not supporting WPA. Patch adds
cipher suites list and fixes NetworkManager not being able to connect to
WPA encrypted APs.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
drivers/net/wireless/rndis_wlan.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index c5b921b..f181b00 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -413,6 +413,13 @@ static const struct ieee80211_rate rndis_rates[] = {
{ .bitrate = 540 }
};
+static const u32 rndis_cipher_suites[] = {
+ WLAN_CIPHER_SUITE_WEP40,
+ WLAN_CIPHER_SUITE_WEP104,
+ WLAN_CIPHER_SUITE_TKIP,
+ WLAN_CIPHER_SUITE_CCMP,
+};
+
struct rndis_wlan_encr_key {
int len;
int cipher;
@@ -441,6 +448,7 @@ struct rndis_wlan_private {
struct ieee80211_supported_band band;
struct ieee80211_channel channels[ARRAY_SIZE(rndis_channels)];
struct ieee80211_rate rates[ARRAY_SIZE(rndis_rates)];
+ u32 cipher_suites[ARRAY_SIZE(rndis_cipher_suites)];
struct iw_statistics iwstats;
struct iw_statistics privstats;
@@ -2892,7 +2900,7 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
| BIT(NL80211_IFTYPE_ADHOC);
wiphy->max_scan_ssids = 1;
- /* TODO: fill-out band information based on priv->caps */
+ /* TODO: fill-out band/encr information based on priv->caps */
rndis_wlan_get_caps(usbdev);
memcpy(priv->channels, rndis_channels, sizeof(rndis_channels));
@@ -2904,6 +2912,11 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
+ memcpy(priv->cipher_suites, rndis_cipher_suites,
+ sizeof(rndis_cipher_suites));
+ wiphy->cipher_suites = priv->cipher_suites;
+ wiphy->n_cipher_suites = ARRAY_SIZE(rndis_cipher_suites);
+
set_wiphy_dev(wiphy, &usbdev->udev->dev);
if (wiphy_register(wiphy)) {
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] rndis_wlan: set cipher suites for cfg80211
2009-08-26 12:53 [PATCH] rndis_wlan: set cipher suites for cfg80211 Jussi Kivilinna
@ 2009-08-26 13:21 ` Holger Schurig
2009-08-26 18:15 ` Jussi Kivilinna
0 siblings, 1 reply; 4+ messages in thread
From: Holger Schurig @ 2009-08-26 13:21 UTC (permalink / raw)
To: Jussi Kivilinna; +Cc: linux-wireless, John W. Linville
> +static const u32 rndis_cipher_suites[] = {
> + WLAN_CIPHER_SUITE_WEP40,
> + WLAN_CIPHER_SUITE_WEP104,
> + WLAN_CIPHER_SUITE_TKIP,
> + WLAN_CIPHER_SUITE_CCMP,
> +};
> +
Okay, this is static, a.k.a. set-in-stone. Then why ...
> + memcpy(priv->cipher_suites, rndis_cipher_suites,
> + sizeof(rndis_cipher_suites));
... copy this to priv?
> + wiphy->cipher_suites = priv->cipher_suites;
> + wiphy->n_cipher_suites = ARRAY_SIZE(rndis_cipher_suites);
Wouldn't
+ wiphy->cipher_suide = rndis_cipher_suites;
+ wiphy->n_cipher_suites = ARRAY_SIZE(rndis_cipher_suites);
do the job? That way you can drop priv->cipher_suites.
--
http://www.holgerschurig.de
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rndis_wlan: set cipher suites for cfg80211
2009-08-26 13:21 ` Holger Schurig
@ 2009-08-26 18:15 ` Jussi Kivilinna
2009-08-27 6:52 ` Holger Schurig
0 siblings, 1 reply; 4+ messages in thread
From: Jussi Kivilinna @ 2009-08-26 18:15 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John W. Linville
Quoting "Holger Schurig" <hs4233@mail.mn-solutions.de>:
>> +static const u32 rndis_cipher_suites[] = {
>> + WLAN_CIPHER_SUITE_WEP40,
>> + WLAN_CIPHER_SUITE_WEP104,
>> + WLAN_CIPHER_SUITE_TKIP,
>> + WLAN_CIPHER_SUITE_CCMP,
>> +};
>> +
>
> Okay, this is static, a.k.a. set-in-stone. Then why ...
>
>> + memcpy(priv->cipher_suites, rndis_cipher_suites,
>> + sizeof(rndis_cipher_suites));
>
> ... copy this to priv?
>
>> + wiphy->cipher_suites = priv->cipher_suites;
>> + wiphy->n_cipher_suites = ARRAY_SIZE(rndis_cipher_suites);
>
> Wouldn't
>
> + wiphy->cipher_suide = rndis_cipher_suites;
> + wiphy->n_cipher_suites = ARRAY_SIZE(rndis_cipher_suites);
>
> do the job? That way you can drop priv->cipher_suites.
>
Yes, that works just fine, and first version was that way. Reason is
that rndis_wlan should really check device capabilities and set cipher
suites
depending by theim (so then per device priv->cipher_suite is needed).
Current static array is not problem as currently there is only one
chip that uses rndis_wlan and array matches its capabilities.
priv->channel/rndis_channels and priv->rate/rndis_rates are the same
and I plan to add caps checking code later.
-Jussi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-27 6:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 12:53 [PATCH] rndis_wlan: set cipher suites for cfg80211 Jussi Kivilinna
2009-08-26 13:21 ` Holger Schurig
2009-08-26 18:15 ` Jussi Kivilinna
2009-08-27 6:52 ` Holger Schurig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.