Revert "ANDROID: virt_wifi: Add data ops for scan data simulation"

This reverts commit 39bb6b4242.

It is not used by anything as the exported symbols are not used
anywhere by any external module.

Bug: 139421123
Cc: lesl <lesl@google.com>
Cc: Alistair Delva <adelva@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5914fb99581dbaa292bff16f20fc1b58da614e18
This commit is contained in:
Greg Kroah-Hartman
2022-08-31 19:12:31 +02:00
parent bd3534dfe8
commit c91e7558fc
2 changed files with 2 additions and 71 deletions

View File

@@ -14,7 +14,6 @@
#include <linux/etherdevice.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <net/virt_wifi.h>
static struct wiphy *common_wiphy;
@@ -22,7 +21,6 @@ struct virt_wifi_wiphy_priv {
struct delayed_work scan_result;
struct cfg80211_scan_request *scan_request;
bool being_deleted;
struct virt_wifi_network_simulation *network_simulation;
};
static struct ieee80211_channel channel_2ghz = {
@@ -174,9 +172,6 @@ static int virt_wifi_scan(struct wiphy *wiphy,
priv->scan_request = request;
schedule_delayed_work(&priv->scan_result, HZ * 2);
if (priv->network_simulation &&
priv->network_simulation->notify_scan_trigger)
priv->network_simulation->notify_scan_trigger(wiphy, request);
return 0;
}
@@ -192,12 +187,6 @@ static void virt_wifi_scan_result(struct work_struct *work)
virt_wifi_inform_bss(wiphy);
if(priv->network_simulation &&
priv->network_simulation->generate_virt_scan_result) {
if(priv->network_simulation->generate_virt_scan_result(wiphy))
wiphy_err(wiphy, "Fail to generater the simulated scan result.\n");
}
/* Schedules work which acquires and releases the rtnl lock. */
cfg80211_scan_done(priv->scan_request, &scan_info);
priv->scan_request = NULL;
@@ -389,8 +378,6 @@ static struct wiphy *virt_wifi_make_wiphy(void)
priv = wiphy_priv(wiphy);
priv->being_deleted = false;
priv->scan_request = NULL;
priv->network_simulation = NULL;
INIT_DELAYED_WORK(&priv->scan_result, virt_wifi_scan_result);
err = wiphy_register(wiphy);
@@ -406,6 +393,7 @@ static struct wiphy *virt_wifi_make_wiphy(void)
static void virt_wifi_destroy_wiphy(struct wiphy *wiphy)
{
struct virt_wifi_wiphy_priv *priv;
WARN(!wiphy, "%s called with null wiphy", __func__);
if (!wiphy)
return;
@@ -439,13 +427,8 @@ static netdev_tx_t virt_wifi_start_xmit(struct sk_buff *skb,
static int virt_wifi_net_device_open(struct net_device *dev)
{
struct virt_wifi_netdev_priv *priv = netdev_priv(dev);
struct virt_wifi_wiphy_priv *w_priv;
priv->is_up = true;
w_priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
if(w_priv->network_simulation &&
w_priv->network_simulation->notify_device_open)
w_priv->network_simulation->notify_device_open(dev);
priv->is_up = true;
return 0;
}
@@ -453,22 +436,16 @@ static int virt_wifi_net_device_open(struct net_device *dev)
static int virt_wifi_net_device_stop(struct net_device *dev)
{
struct virt_wifi_netdev_priv *n_priv = netdev_priv(dev);
struct virt_wifi_wiphy_priv *w_priv;
n_priv->is_up = false;
if (!dev->ieee80211_ptr)
return 0;
w_priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
virt_wifi_cancel_scan(dev->ieee80211_ptr->wiphy);
virt_wifi_cancel_connect(dev);
netif_carrier_off(dev);
if (w_priv->network_simulation &&
w_priv->network_simulation->notify_device_stop)
w_priv->network_simulation->notify_device_stop(dev);
return 0;
}
@@ -711,27 +688,6 @@ static void __exit virt_wifi_cleanup_module(void)
unregister_netdevice_notifier(&virt_wifi_notifier);
}
int virt_wifi_register_network_simulation
(struct virt_wifi_network_simulation *ops)
{
struct virt_wifi_wiphy_priv *priv = wiphy_priv(common_wiphy);
if (priv->network_simulation)
return -EEXIST;
priv->network_simulation = ops;
return 0;
}
EXPORT_SYMBOL_GPL(virt_wifi_register_network_simulation);
int virt_wifi_unregister_network_simulation(void)
{
struct virt_wifi_wiphy_priv *priv = wiphy_priv(common_wiphy);
if(!priv->network_simulation)
return -ENODATA;
priv->network_simulation = NULL;
return 0;
}
EXPORT_SYMBOL_GPL(virt_wifi_unregister_network_simulation);
module_init(virt_wifi_init_module);
module_exit(virt_wifi_cleanup_module);

View File

@@ -1,25 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* include/net/virt_wifi.h
*
* Define the extension interface for the network data simulation
*
* Copyright (C) 2019 Google, Inc.
*
* Author: lesl@google.com
*/
#ifndef __VIRT_WIFI_H
#define __VIRT_WIFI_H
struct virt_wifi_network_simulation {
void (*notify_device_open)(struct net_device *dev);
void (*notify_device_stop)(struct net_device *dev);
void (*notify_scan_trigger)(struct wiphy *wiphy,
struct cfg80211_scan_request *request);
int (*generate_virt_scan_result)(struct wiphy *wiphy);
};
int virt_wifi_register_network_simulation(
struct virt_wifi_network_simulation *ops);
int virt_wifi_unregister_network_simulation(void);
#endif