linux/drivers/net/wireless/virtual/virt_wifi.c

// SPDX-License-Identifier: GPL-2.0
/* drivers/net/wireless/virt_wifi.c
 *
 * A fake implementation of cfg80211_ops that can be tacked on to an ethernet
 * net_device to make it appear as a wireless connection.
 *
 * Copyright (C) 2018 Google, Inc.
 *
 * Author: [email protected]
 */

#include <net/cfg80211.h>
#include <net/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/math64.h>
#include <linux/module.h>

static struct wiphy *common_wiphy;

struct virt_wifi_wiphy_priv {};

static struct ieee80211_channel channel_2ghz =;

static struct ieee80211_rate bitrates_2ghz[] =;

static struct ieee80211_supported_band band_2ghz =;

static struct ieee80211_channel channel_5ghz =;

static struct ieee80211_rate bitrates_5ghz[] =;

#define RX_MCS_MAP

#define TX_MCS_MAP

static struct ieee80211_supported_band band_5ghz =;

/* Assigned at module init. Guaranteed locally-administered and unicast. */
static u8 fake_router_bssid[ETH_ALEN] __ro_after_init =;

#define VIRT_WIFI_SSID
#define VIRT_WIFI_SSID_LEN

static void virt_wifi_inform_bss(struct wiphy *wiphy)
{}

/* Called with the rtnl lock held. */
static int virt_wifi_scan(struct wiphy *wiphy,
			  struct cfg80211_scan_request *request)
{}

/* Acquires and releases the rdev BSS lock. */
static void virt_wifi_scan_result(struct work_struct *work)
{}

/* May acquire and release the rdev BSS lock. */
static void virt_wifi_cancel_scan(struct wiphy *wiphy)
{}

struct virt_wifi_netdev_priv {};

/* Called with the rtnl lock held. */
static int virt_wifi_connect(struct wiphy *wiphy, struct net_device *netdev,
			     struct cfg80211_connect_params *sme)
{}

/* Acquires and releases the rdev event lock. */
static void virt_wifi_connect_complete(struct work_struct *work)
{}

/* May acquire and release the rdev event lock. */
static void virt_wifi_cancel_connect(struct net_device *netdev)
{}

/* Called with the rtnl lock held. Acquires the rdev event lock. */
static int virt_wifi_disconnect(struct wiphy *wiphy, struct net_device *netdev,
				u16 reason_code)
{}

/* Called with the rtnl lock held. */
static int virt_wifi_get_station(struct wiphy *wiphy, struct net_device *dev,
				 const u8 *mac, struct station_info *sinfo)
{}

/* Called with the rtnl lock held. */
static int virt_wifi_dump_station(struct wiphy *wiphy, struct net_device *dev,
				  int idx, u8 *mac, struct station_info *sinfo)
{}

static const struct cfg80211_ops virt_wifi_cfg80211_ops =;

/* Acquires and releases the rtnl lock. */
static struct wiphy *virt_wifi_make_wiphy(void)
{}

/* Acquires and releases the rtnl lock. */
static void virt_wifi_destroy_wiphy(struct wiphy *wiphy)
{}

/* Enters and exits a RCU-bh critical section. */
static netdev_tx_t virt_wifi_start_xmit(struct sk_buff *skb,
					struct net_device *dev)
{}

/* Called with rtnl lock held. */
static int virt_wifi_net_device_open(struct net_device *dev)
{}

/* Called with rtnl lock held. */
static int virt_wifi_net_device_stop(struct net_device *dev)
{}

static int virt_wifi_net_device_get_iflink(const struct net_device *dev)
{}

static const struct net_device_ops virt_wifi_ops =;

/* Invoked as part of rtnl lock release. */
static void virt_wifi_net_device_destructor(struct net_device *dev)
{}

/* No lock interaction. */
static void virt_wifi_setup(struct net_device *dev)
{}

/* Called in a RCU read critical section from netif_receive_skb */
static rx_handler_result_t virt_wifi_rx_handler(struct sk_buff **pskb)
{}

/* Called with rtnl lock held. */
static int virt_wifi_newlink(struct net *src_net, struct net_device *dev,
			     struct nlattr *tb[], struct nlattr *data[],
			     struct netlink_ext_ack *extack)
{}

/* Called with rtnl lock held. */
static void virt_wifi_dellink(struct net_device *dev,
			      struct list_head *head)
{}

static struct rtnl_link_ops virt_wifi_link_ops =;

static bool netif_is_virt_wifi_dev(const struct net_device *dev)
{}

static int virt_wifi_event(struct notifier_block *this, unsigned long event,
			   void *ptr)
{}

static struct notifier_block virt_wifi_notifier =;

/* Acquires and releases the rtnl lock. */
static int __init virt_wifi_init_module(void)
{}

/* Acquires and releases the rtnl lock. */
static void __exit virt_wifi_cleanup_module(void)
{}

module_init();
module_exit(virt_wifi_cleanup_module);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_ALIAS_RTNL_LINK();