struct il_priv *il = hw->priv;
struct il_vif_priv *vif_priv = (void *)vif->drv_priv;
int err;
+ bool reset;
u32 modes;
D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
goto out;
}
+ /*
+ * We do not support multiple virtual interfaces, but on hardware reset
+ * we have to add the same interface again.
+ */
+ reset = (il->ctx.vif == vif);
+ if (il->ctx.vif && !reset) {
+ err = -EOPNOTSUPP;
+ goto out;
+ }
+
modes = il->ctx.interface_modes | il->ctx.exclusive_interface_modes;
if (!(modes & BIT(vif->type))) {
err = -EOPNOTSUPP;
err = il_setup_interface(il, &il->ctx);
if (err) {
- il->ctx.vif = NULL;
- il->iw_mode = NL80211_IFTYPE_STATION;
+ IL_WARN("Fail to set mode %d\n", vif->type);
+ if (!reset) {
+ il->ctx.vif = NULL;
+ il->iw_mode = NL80211_IFTYPE_STATION;
+ }
}
out: