Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306796
b: refs/heads/master
c: 4f02341
h: refs/heads/master
v: v3
  • Loading branch information
Avinash Patil authored and John W. Linville committed May 16, 2012
1 parent a7b14dd commit 918eca1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26134e6eb512016edf17b4a904b1c19b22669421
refs/heads/master: 4f02341ac27f70700a4fff4f3671857ca4227822
64 changes: 46 additions & 18 deletions trunk/drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,31 +497,59 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
int ret;
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);

if (priv->bss_mode == type) {
wiphy_warn(wiphy, "already set to required type\n");
return 0;
}

priv->bss_mode = type;

switch (type) {
switch (dev->ieee80211_ptr->iftype) {
case NL80211_IFTYPE_ADHOC:
dev->ieee80211_ptr->iftype = NL80211_IFTYPE_ADHOC;
wiphy_dbg(wiphy, "info: setting interface type to adhoc\n");
switch (type) {
case NL80211_IFTYPE_STATION:
break;
case NL80211_IFTYPE_UNSPECIFIED:
wiphy_warn(wiphy, "%s: kept type as IBSS\n", dev->name);
case NL80211_IFTYPE_ADHOC: /* This shouldn't happen */
return 0;
case NL80211_IFTYPE_AP:
default:
wiphy_err(wiphy, "%s: changing to %d not supported\n",
dev->name, type);
return -EOPNOTSUPP;
}
break;
case NL80211_IFTYPE_STATION:
dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION;
wiphy_dbg(wiphy, "info: setting interface type to managed\n");
switch (type) {
case NL80211_IFTYPE_ADHOC:
break;
case NL80211_IFTYPE_UNSPECIFIED:
wiphy_warn(wiphy, "%s: kept type as STA\n", dev->name);
case NL80211_IFTYPE_STATION: /* This shouldn't happen */
return 0;
case NL80211_IFTYPE_AP:
default:
wiphy_err(wiphy, "%s: changing to %d not supported\n",
dev->name, type);
return -EOPNOTSUPP;
}
break;
case NL80211_IFTYPE_AP:
switch (type) {
case NL80211_IFTYPE_UNSPECIFIED:
wiphy_warn(wiphy, "%s: kept type as AP\n", dev->name);
case NL80211_IFTYPE_AP: /* This shouldn't happen */
return 0;
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_STATION:
default:
wiphy_err(wiphy, "%s: changing to %d not supported\n",
dev->name, type);
return -EOPNOTSUPP;
}
break;
case NL80211_IFTYPE_UNSPECIFIED:
dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION;
wiphy_dbg(wiphy, "info: setting interface type to auto\n");
return 0;
default:
wiphy_err(wiphy, "unknown interface type: %d\n", type);
return -EINVAL;
wiphy_err(wiphy, "%s: unknown iftype: %d\n",
dev->name, dev->ieee80211_ptr->iftype);
return -EOPNOTSUPP;
}

dev->ieee80211_ptr->iftype = type;
priv->bss_mode = type;
mwifiex_deauthenticate(priv, NULL);

priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
Expand Down

0 comments on commit 918eca1

Please sign in to comment.