|
@@ -126,7 +126,7 @@ static void decrease_tailroom_need_count(struct ieee80211_sub_if_data *sdata,
|
|
|
|
|
|
static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
|
|
|
{
|
|
|
- struct ieee80211_sub_if_data *sdata;
|
|
|
+ struct ieee80211_sub_if_data *sdata = key->sdata;
|
|
|
struct sta_info *sta;
|
|
|
int ret = -EOPNOTSUPP;
|
|
|
|
|
@@ -162,7 +162,6 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
|
|
|
if (sta && !sta->uploaded)
|
|
|
goto out_unsupported;
|
|
|
|
|
|
- sdata = key->sdata;
|
|
|
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
|
|
|
/*
|
|
|
* The driver doesn't know anything about VLAN interfaces.
|
|
@@ -214,8 +213,11 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
|
|
|
/* all of these we can do in software - if driver can */
|
|
|
if (ret == 1)
|
|
|
return 0;
|
|
|
- if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL))
|
|
|
+ if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) {
|
|
|
+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
|
|
|
+ return 0;
|
|
|
return -EINVAL;
|
|
|
+ }
|
|
|
return 0;
|
|
|
default:
|
|
|
return -EINVAL;
|