linux/drivers/staging/vt6655/device_main.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * Purpose: driver entry for initial, open, close, tx and rx.
 *
 * Author: Lyndon Chen
 *
 * Date: Jan 8, 2003
 *
 * Functions:
 *
 *   vt6655_probe - module initial (insmod) driver entry
 *   vt6655_remove - module remove entry
 *   device_free_info - device structure resource free function
 *   device_print_info - print out resource
 *   device_rx_srv - rx service function
 *   device_alloc_rx_buf - rx buffer pre-allocated function
 *   device_free_rx_buf - free rx buffer function
 *   device_free_tx_buf - free tx buffer function
 *   device_init_rd0_ring - initial rd dma0 ring
 *   device_init_rd1_ring - initial rd dma1 ring
 *   device_init_td0_ring - initial tx dma0 ring buffer
 *   device_init_td1_ring - initial tx dma1 ring buffer
 *   device_init_registers - initial MAC & BBP & RF internal registers.
 *   device_init_rings - initial tx/rx ring buffer
 *   device_free_rings - free all allocated ring buffer
 *   device_tx_srv - tx interrupt service function
 *
 * Revision History:
 */

#include <linux/file.h>
#include "device.h"
#include "card.h"
#include "channel.h"
#include "baseband.h"
#include "mac.h"
#include "power.h"
#include "rxtx.h"
#include "dpc.h"
#include "rf.h"
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/slab.h>

/*---------------------  Static Definitions -------------------------*/
/*
 * Define module options
 */
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();

#define DEVICE_PARAM(N, D)

#define RX_DESC_MIN0
#define RX_DESC_MAX0
#define RX_DESC_DEF0
DEVICE_PARAM(RxDescriptors0, "Number of receive descriptors0");

#define RX_DESC_MIN1
#define RX_DESC_MAX1
#define RX_DESC_DEF1
DEVICE_PARAM(RxDescriptors1, "Number of receive descriptors1");

#define TX_DESC_MIN0
#define TX_DESC_MAX0
#define TX_DESC_DEF0
DEVICE_PARAM(TxDescriptors0, "Number of transmit descriptors0");

#define TX_DESC_MIN1
#define TX_DESC_MAX1
#define TX_DESC_DEF1
DEVICE_PARAM(TxDescriptors1, "Number of transmit descriptors1");

#define INT_WORKS_DEF
#define INT_WORKS_MIN
#define INT_WORKS_MAX

DEVICE_PARAM(int_works, "Number of packets per interrupt services");

#define RTS_THRESH_DEF

#define FRAG_THRESH_DEF

#define SHORT_RETRY_MIN
#define SHORT_RETRY_MAX
#define SHORT_RETRY_DEF

DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits");

#define LONG_RETRY_MIN
#define LONG_RETRY_MAX
#define LONG_RETRY_DEF

DEVICE_PARAM(LongRetryLimit, "long frame retry limits");

/* BasebandType[] baseband type selected
 * 0: indicate 802.11a type
 * 1: indicate 802.11b type
 * 2: indicate 802.11g type
 */
#define BBP_TYPE_MIN
#define BBP_TYPE_MAX
#define BBP_TYPE_DEF

DEVICE_PARAM(BasebandType, "baseband type");

/*
 * Static vars definitions
 */
static const struct pci_device_id vt6655_pci_id_table[] =;

/*---------------------  Static Functions  --------------------------*/

static int  vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent);
static void device_free_info(struct vnt_private *priv);
static void device_print_info(struct vnt_private *priv);

static void vt6655_mac_write_bssid_addr(void __iomem *iobase, const u8 *mac_addr);
static void vt6655_mac_read_ether_addr(void __iomem *iobase, u8 *mac_addr);

static int device_init_rd0_ring(struct vnt_private *priv);
static int device_init_rd1_ring(struct vnt_private *priv);
static int device_init_td0_ring(struct vnt_private *priv);
static int device_init_td1_ring(struct vnt_private *priv);

static int  device_rx_srv(struct vnt_private *priv, unsigned int idx);
static int  device_tx_srv(struct vnt_private *priv, unsigned int idx);
static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *);
static void device_free_rx_buf(struct vnt_private *priv,
			       struct vnt_rx_desc *rd);
static void device_init_registers(struct vnt_private *priv);
static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *);
static void device_free_td0_ring(struct vnt_private *priv);
static void device_free_td1_ring(struct vnt_private *priv);
static void device_free_rd0_ring(struct vnt_private *priv);
static void device_free_rd1_ring(struct vnt_private *priv);
static void device_free_rings(struct vnt_private *priv);

/*---------------------  Export Variables  --------------------------*/

/*---------------------  Export Functions  --------------------------*/

static void vt6655_remove(struct pci_dev *pcid)
{}

static void device_get_options(struct vnt_private *priv)
{}

static void
device_set_options(struct vnt_private *priv)
{}

static void vt6655_mac_write_bssid_addr(void __iomem *iobase, const u8 *mac_addr)
{}

static void vt6655_mac_read_ether_addr(void __iomem *iobase, u8 *mac_addr)
{}

static void vt6655_mac_dma_ctl(void __iomem *iobase, u8 reg_index)
{}

static void vt6655_mac_set_bits(void __iomem *iobase, u32 mask)
{}

static void vt6655_mac_clear_bits(void __iomem *iobase, u32 mask)
{}

static void vt6655_mac_en_protect_md(void __iomem *iobase)
{}

static void vt6655_mac_dis_protect_md(void __iomem *iobase)
{}

static void vt6655_mac_en_barker_preamble_md(void __iomem *iobase)
{}

static void vt6655_mac_dis_barker_preamble_md(void __iomem *iobase)
{}

/*
 * Initialisation of MAC & BBP registers
 */

static void device_init_registers(struct vnt_private *priv)
{}

static void device_print_info(struct vnt_private *priv)
{}

static void device_free_info(struct vnt_private *priv)
{}

static bool device_init_rings(struct vnt_private *priv)
{}

static void device_free_rings(struct vnt_private *priv)
{}

static int device_init_rd0_ring(struct vnt_private *priv)
{}

static int device_init_rd1_ring(struct vnt_private *priv)
{}

static void device_free_rd0_ring(struct vnt_private *priv)
{}

static void device_free_rd1_ring(struct vnt_private *priv)
{}

static int device_init_td0_ring(struct vnt_private *priv)
{}

static int device_init_td1_ring(struct vnt_private *priv)
{}

static void device_free_td0_ring(struct vnt_private *priv)
{}

static void device_free_td1_ring(struct vnt_private *priv)
{}

/*-----------------------------------------------------------------*/

static int device_rx_srv(struct vnt_private *priv, unsigned int idx)
{}

static bool device_alloc_rx_buf(struct vnt_private *priv,
				struct vnt_rx_desc *rd)
{}

static void device_free_rx_buf(struct vnt_private *priv,
			       struct vnt_rx_desc *rd)
{}

static const u8 fallback_rate0[5][5] =;

static const u8 fallback_rate1[5][5] =;

static int vnt_int_report_rate(struct vnt_private *priv,
			       struct vnt_td_info *context, u8 tsr0, u8 tsr1)
{}

static int device_tx_srv(struct vnt_private *priv, unsigned int idx)
{}

static void device_error(struct vnt_private *priv, unsigned short status)
{}

static void device_free_tx_buf(struct vnt_private *priv,
			       struct vnt_tx_desc *desc)
{}

static void vnt_check_bb_vga(struct vnt_private *priv)
{}

static void vnt_interrupt_process(struct vnt_private *priv)
{}

static void vnt_interrupt_work(struct work_struct *work)
{}

static irqreturn_t vnt_interrupt(int irq,  void *arg)
{}

static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
{}

static void vnt_tx_80211(struct ieee80211_hw *hw,
			 struct ieee80211_tx_control *control,
			 struct sk_buff *skb)
{}

static int vnt_start(struct ieee80211_hw *hw)
{}

static void vnt_stop(struct ieee80211_hw *hw, bool suspend)
{}

static int vnt_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}

static void vnt_remove_interface(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif)
{}

static int vnt_config(struct ieee80211_hw *hw, u32 changed)
{}

static void vnt_bss_info_changed(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif,
				 struct ieee80211_bss_conf *conf, u64 changed)
{}

static u64 vnt_prepare_multicast(struct ieee80211_hw *hw,
				 struct netdev_hw_addr_list *mc_list)
{}

static void vnt_configure(struct ieee80211_hw *hw,
			  unsigned int changed_flags,
			  unsigned int *total_flags, u64 multicast)
{}

static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
		       struct ieee80211_vif *vif, struct ieee80211_sta *sta,
		       struct ieee80211_key_conf *key)
{}

static int vnt_get_stats(struct ieee80211_hw *hw,
			 struct ieee80211_low_level_stats *stats)
{}

static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}

static void vnt_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			u64 tsf)
{}

static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}

static const struct ieee80211_ops vnt_mac_ops =;

static int vnt_init(struct vnt_private *priv)
{}

static int
vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
{}

/*------------------------------------------------------------------*/

static int __maybe_unused vt6655_suspend(struct device *dev_d)
{}

static int __maybe_unused vt6655_resume(struct device *dev_d)
{}

MODULE_DEVICE_TABLE();

static SIMPLE_DEV_PM_OPS(vt6655_pm_ops, vt6655_suspend, vt6655_resume);

static struct pci_driver device_driver =;

module_pci_driver();