Revert "cfg80211: export interface stopping function"

This reverts commit f04c22033c.

The commit "cfg80211: export interface stopping function" exports a new
cfg80211_stop_iface() function, intended for driver internal interface
combination management and channel switching. The new function is used
by commit "cfg80211/mac80211: disconnect on suspend" which is reverted
in order to avoid the disconnection while going to suspend. Hence the
commit "cfg80211: export interface stopping function" should be reverted.

CRs-Fixed: 540571
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
This commit is contained in:
Ahmad Kholaif 2013-11-23 11:05:56 +05:30 committed by David Keitel
parent 1bbf97af3a
commit bf6ab094ca
7 changed files with 11 additions and 81 deletions

View file

@ -5298,21 +5298,6 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
void *data), void *data),
void *data); void *data);
/*
* cfg80211_stop_iface - trigger interface disconnection
*
* @wiphy: the wiphy
* @wdev: wireless device
* @gfp: context flags
*
* Trigger interface to be stopped as if AP was stopped, IBSS/mesh left, STA
* disconnected.
*
* Note: This doesn't need any locks and is asynchronous.
*/
void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
gfp_t gfp);
/** /**
* cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy
* @wiphy: the wiphy to shut down * @wiphy: the wiphy to shut down

View file

@ -6,7 +6,7 @@
#include "rdev-ops.h" #include "rdev-ops.h"
int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev, static int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool notify) struct net_device *dev, bool notify)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;

View file

@ -887,25 +887,24 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
rdev->num_running_monitor_ifaces += num; rdev->num_running_monitor_ifaces += num;
} }
void __cfg80211_leave(struct cfg80211_registered_device *rdev, void cfg80211_leave(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev) struct wireless_dev *wdev)
{ {
struct net_device *dev = wdev->netdev; struct net_device *dev = wdev->netdev;
struct cfg80211_sched_scan_request *sched_scan_req; struct cfg80211_sched_scan_request *sched_scan_req;
ASSERT_RTNL(); ASSERT_RTNL();
ASSERT_WDEV_LOCK(wdev);
switch (wdev->iftype) { switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
__cfg80211_leave_ibss(rdev, dev, true); cfg80211_leave_ibss(rdev, dev, true);
break; break;
case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
sched_scan_req = rtnl_dereference(rdev->sched_scan_req); sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
if (sched_scan_req && dev == sched_scan_req->dev) if (sched_scan_req && dev == sched_scan_req->dev)
__cfg80211_stop_sched_scan(rdev, false); __cfg80211_stop_sched_scan(rdev, false);
wdev_lock(wdev);
#ifdef CONFIG_CFG80211_WEXT #ifdef CONFIG_CFG80211_WEXT
kfree(wdev->wext.ie); kfree(wdev->wext.ie);
wdev->wext.ie = NULL; wdev->wext.ie = NULL;
@ -914,13 +913,14 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
#endif #endif
cfg80211_disconnect(rdev, dev, cfg80211_disconnect(rdev, dev,
WLAN_REASON_DEAUTH_LEAVING, true); WLAN_REASON_DEAUTH_LEAVING, true);
wdev_unlock(wdev);
break; break;
case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_MESH_POINT:
__cfg80211_leave_mesh(rdev, dev); cfg80211_leave_mesh(rdev, dev);
break; break;
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_GO:
__cfg80211_stop_ap(rdev, dev, true); cfg80211_stop_ap(rdev, dev, true);
break; break;
case NL80211_IFTYPE_OCB: case NL80211_IFTYPE_OCB:
__cfg80211_leave_ocb(rdev, dev); __cfg80211_leave_ocb(rdev, dev);
@ -942,36 +942,6 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
} }
} }
void cfg80211_leave(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
wdev_lock(wdev);
__cfg80211_leave(rdev, wdev);
wdev_unlock(wdev);
}
void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
gfp_t gfp)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
struct cfg80211_event *ev;
unsigned long flags;
trace_cfg80211_stop_iface(wiphy, wdev);
ev = kzalloc(sizeof(*ev), gfp);
if (!ev)
return;
ev->type = EVENT_STOPPED;
spin_lock_irqsave(&wdev->event_lock, flags);
list_add_tail(&ev->list, &wdev->event_list);
spin_unlock_irqrestore(&wdev->event_lock, flags);
queue_work(cfg80211_wq, &rdev->event_work);
}
EXPORT_SYMBOL(cfg80211_stop_iface);
static int cfg80211_netdev_notifier_call(struct notifier_block *nb, static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
unsigned long state, void *ptr) unsigned long state, void *ptr)
{ {

View file

@ -200,7 +200,6 @@ enum cfg80211_event_type {
EVENT_ROAMED, EVENT_ROAMED,
EVENT_DISCONNECTED, EVENT_DISCONNECTED,
EVENT_IBSS_JOINED, EVENT_IBSS_JOINED,
EVENT_STOPPED,
}; };
struct cfg80211_event { struct cfg80211_event {
@ -298,8 +297,6 @@ int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
struct net_device *dev, struct net_device *dev,
struct mesh_setup *setup, struct mesh_setup *setup,
const struct mesh_config *conf); const struct mesh_config *conf);
int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
struct net_device *dev);
int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev, int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
struct net_device *dev); struct net_device *dev);
int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev, int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
@ -319,8 +316,6 @@ int cfg80211_leave_ocb(struct cfg80211_registered_device *rdev,
struct net_device *dev); struct net_device *dev);
/* AP */ /* AP */
int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool notify);
int cfg80211_stop_ap(struct cfg80211_registered_device *rdev, int cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool notify); struct net_device *dev, bool notify);
@ -475,8 +470,6 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
enum nl80211_iftype iftype, int num); enum nl80211_iftype iftype, int num);
void __cfg80211_leave(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev);
void cfg80211_leave(struct cfg80211_registered_device *rdev, void cfg80211_leave(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev); struct wireless_dev *wdev);

View file

@ -238,7 +238,7 @@ int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
return 0; return 0;
} }
int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev, static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
struct net_device *dev) struct net_device *dev)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;

View file

@ -2803,21 +2803,6 @@ TRACE_EVENT(cfg80211_ft_event,
WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap)) WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
); );
TRACE_EVENT(cfg80211_stop_iface,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev),
TP_STRUCT__entry(
WIPHY_ENTRY
WDEV_ENTRY
),
TP_fast_assign(
WIPHY_ASSIGN;
WDEV_ASSIGN;
),
TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
WIPHY_PR_ARG, WDEV_PR_ARG)
);
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */ #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH

View file

@ -894,9 +894,6 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev)
__cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid, __cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid,
ev->ij.channel); ev->ij.channel);
break; break;
case EVENT_STOPPED:
__cfg80211_leave(wiphy_to_rdev(wdev->wiphy), wdev);
break;
} }
wdev_unlock(wdev); wdev_unlock(wdev);