cfg80211: move add/change interface monitor flags into params
Instead passing both flags, which can be NULL, and vif_params, which are never NULL, move the flags into the vif_params and use BIT(0), which is invalid from userspace, to indicate that the flags were changed. While updating all drivers, fix a small bug in wil6210 where it was setting the flags to 0 instead of leaving them unchanged. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -1657,7 +1657,7 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev,
|
||||
*/
|
||||
|
||||
static int lbs_change_intf(struct wiphy *wiphy, struct net_device *dev,
|
||||
enum nl80211_iftype type, u32 *flags,
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct lbs_private *priv = wiphy_priv(wiphy);
|
||||
|
@@ -916,7 +916,7 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv,
|
||||
static int
|
||||
mwifiex_change_vif_to_p2p(struct net_device *dev,
|
||||
enum nl80211_iftype curr_iftype,
|
||||
enum nl80211_iftype type, u32 *flags,
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct mwifiex_private *priv;
|
||||
@@ -988,7 +988,7 @@ mwifiex_change_vif_to_p2p(struct net_device *dev,
|
||||
static int
|
||||
mwifiex_change_vif_to_sta_adhoc(struct net_device *dev,
|
||||
enum nl80211_iftype curr_iftype,
|
||||
enum nl80211_iftype type, u32 *flags,
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct mwifiex_private *priv;
|
||||
@@ -1047,7 +1047,7 @@ mwifiex_change_vif_to_sta_adhoc(struct net_device *dev,
|
||||
static int
|
||||
mwifiex_change_vif_to_ap(struct net_device *dev,
|
||||
enum nl80211_iftype curr_iftype,
|
||||
enum nl80211_iftype type, u32 *flags,
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct mwifiex_private *priv;
|
||||
@@ -1103,7 +1103,7 @@ mwifiex_change_vif_to_ap(struct net_device *dev,
|
||||
static int
|
||||
mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
enum nl80211_iftype type, u32 *flags,
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
|
||||
@@ -1124,10 +1124,10 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
return mwifiex_change_vif_to_p2p(dev, curr_iftype,
|
||||
type, flags, params);
|
||||
type, params);
|
||||
case NL80211_IFTYPE_AP:
|
||||
return mwifiex_change_vif_to_ap(dev, curr_iftype, type,
|
||||
flags, params);
|
||||
params);
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
mwifiex_dbg(priv->adapter, INFO,
|
||||
"%s: kept type as IBSS\n", dev->name);
|
||||
@@ -1154,10 +1154,10 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
return mwifiex_change_vif_to_p2p(dev, curr_iftype,
|
||||
type, flags, params);
|
||||
type, params);
|
||||
case NL80211_IFTYPE_AP:
|
||||
return mwifiex_change_vif_to_ap(dev, curr_iftype, type,
|
||||
flags, params);
|
||||
params);
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
mwifiex_dbg(priv->adapter, INFO,
|
||||
"%s: kept type as STA\n", dev->name);
|
||||
@@ -1175,13 +1175,12 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype,
|
||||
type, flags,
|
||||
params);
|
||||
type, params);
|
||||
break;
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
return mwifiex_change_vif_to_p2p(dev, curr_iftype,
|
||||
type, flags, params);
|
||||
type, params);
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
mwifiex_dbg(priv->adapter, INFO,
|
||||
"%s: kept type as AP\n", dev->name);
|
||||
@@ -1214,14 +1213,13 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
if (mwifiex_cfg80211_deinit_p2p(priv))
|
||||
return -EFAULT;
|
||||
return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype,
|
||||
type, flags,
|
||||
params);
|
||||
type, params);
|
||||
break;
|
||||
case NL80211_IFTYPE_AP:
|
||||
if (mwifiex_cfg80211_deinit_p2p(priv))
|
||||
return -EFAULT;
|
||||
return mwifiex_change_vif_to_ap(dev, curr_iftype, type,
|
||||
flags, params);
|
||||
params);
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
mwifiex_dbg(priv->adapter, INFO,
|
||||
"%s: kept type as P2P\n", dev->name);
|
||||
@@ -2822,7 +2820,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
const char *name,
|
||||
unsigned char name_assign_type,
|
||||
enum nl80211_iftype type,
|
||||
u32 *flags,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy);
|
||||
|
@@ -593,7 +593,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
rtnl_lock();
|
||||
/* Create station interface by default */
|
||||
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM,
|
||||
NL80211_IFTYPE_STATION, NULL, NULL);
|
||||
NL80211_IFTYPE_STATION, NULL);
|
||||
if (IS_ERR(wdev)) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"cannot create default STA interface\n");
|
||||
@@ -603,7 +603,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
|
||||
if (driver_mode & MWIFIEX_DRIVER_MODE_UAP) {
|
||||
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM,
|
||||
NL80211_IFTYPE_AP, NULL, NULL);
|
||||
NL80211_IFTYPE_AP, NULL);
|
||||
if (IS_ERR(wdev)) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"cannot create AP interface\n");
|
||||
@@ -614,8 +614,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
|
||||
if (driver_mode & MWIFIEX_DRIVER_MODE_P2P) {
|
||||
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", NET_NAME_ENUM,
|
||||
NL80211_IFTYPE_P2P_CLIENT, NULL,
|
||||
NULL);
|
||||
NL80211_IFTYPE_P2P_CLIENT, NULL);
|
||||
if (IS_ERR(wdev)) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"cannot create p2p client interface\n");
|
||||
|
@@ -1529,7 +1529,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||
const char *name,
|
||||
unsigned char name_assign_type,
|
||||
enum nl80211_iftype type,
|
||||
u32 *flags,
|
||||
struct vif_params *params);
|
||||
int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
|
||||
|
||||
|
Reference in New Issue
Block a user