|
@@ -81,16 +81,14 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
|
|
u8 key_idx, const u8 *mac_addr,
|
|
u8 key_idx, const u8 *mac_addr,
|
|
struct key_params *params)
|
|
struct key_params *params)
|
|
{
|
|
{
|
|
- struct ieee80211_sub_if_data *sdata;
|
|
|
|
|
|
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
|
struct sta_info *sta = NULL;
|
|
struct sta_info *sta = NULL;
|
|
struct ieee80211_key *key;
|
|
struct ieee80211_key *key;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
- if (!netif_running(dev))
|
|
|
|
|
|
+ if (!ieee80211_sdata_running(sdata))
|
|
return -ENETDOWN;
|
|
return -ENETDOWN;
|
|
|
|
|
|
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
|
|
|
-
|
|
|
|
/* reject WEP and TKIP keys if WEP failed to initialize */
|
|
/* reject WEP and TKIP keys if WEP failed to initialize */
|
|
switch (params->cipher) {
|
|
switch (params->cipher) {
|
|
case WLAN_CIPHER_SUITE_WEP40:
|
|
case WLAN_CIPHER_SUITE_WEP40:
|