From c91e7558fcbd6498fcb51ef7a48813996edeb53a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 31 Aug 2022 19:12:31 +0200 Subject: [PATCH] Revert "ANDROID: virt_wifi: Add data ops for scan data simulation" This reverts commit 39bb6b4242ff4426bb9f2d032e5a1e4e5f8c2db8. It is not used by anything as the exported symbols are not used anywhere by any external module. Bug: 139421123 Cc: lesl Cc: Alistair Delva Signed-off-by: Greg Kroah-Hartman Change-Id: I5914fb99581dbaa292bff16f20fc1b58da614e18 --- drivers/net/wireless/virt_wifi.c | 48 ++------------------------------ include/net/virt_wifi.h | 25 ----------------- 2 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 include/net/virt_wifi.h diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c index 3c1c2c6c5dea..ba14d83353a4 100644 --- a/drivers/net/wireless/virt_wifi.c +++ b/drivers/net/wireless/virt_wifi.c @@ -14,7 +14,6 @@ #include #include #include -#include 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); diff --git a/include/net/virt_wifi.h b/include/net/virt_wifi.h deleted file mode 100644 index 343e73968d41..000000000000 --- a/include/net/virt_wifi.h +++ /dev/null @@ -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 -