linux/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c


/* Linux device driver for RTL8180 / RTL8185 / RTL8187SE
 *
 * Copyright 2007 Michael Wu <[email protected]>
 * Copyright 2007,2014 Andrea Merello <[email protected]>
 *
 * Based on the r8180 driver, which is:
 * Copyright 2004-2005 Andrea Merello <[email protected]>, et al.
 *
 * Thanks to Realtek for their support!
 *
 ************************************************************************
 *
 * The driver was extended to the RTL8187SE in 2014 by
 * Andrea Merello <[email protected]>
 *
 * based also on:
 *  - portions of rtl8187se Linux staging driver, Copyright Realtek corp.
 *    (available in drivers/staging/rtl8187se directory of Linux 3.14)
 *  - other GPL, unpublished (until now), Linux driver code,
 *    Copyright Larry Finger <[email protected]>
 *
 * A huge thanks goes to Sara V. Nari who forgives me when I'm
 * sitting in front of my laptop at evening, week-end, night...
 *
 * A special thanks goes to Antonio Cuni, who helped me with
 * some python userspace stuff I used to debug RTL8187SE code, and who
 * bought a laptop with an unsupported Wi-Fi card some years ago...
 *
 * Thanks to Larry Finger for writing some code for rtl8187se and for
 * his suggestions.
 *
 * Thanks to Dan Carpenter for reviewing my initial patch and for his
 * suggestions.
 *
 * Thanks to Bernhard Schiffner for his help in testing and for his
 * suggestions.
 *
 ************************************************************************
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/eeprom_93cx6.h>
#include <linux/module.h>
#include <net/mac80211.h>

#include "rtl8180.h"
#include "rtl8225.h"
#include "sa2400.h"
#include "max2820.h"
#include "grf5101.h"
#include "rtl8225se.h"

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

static const struct pci_device_id rtl8180_table[] =;

MODULE_DEVICE_TABLE(pci, rtl8180_table);

static const struct ieee80211_rate rtl818x_rates[] =;

static const struct ieee80211_channel rtl818x_channels[] =;

/* Queues for rtl8187se card
 *
 * name | reg  |  queue
 *  BC  |  7   |   6
 *  MG  |  1   |   0
 *  HI  |  6   |   1
 *  VO  |  5   |   2
 *  VI  |  4   |   3
 *  BE  |  3   |   4
 *  BK  |  2   |   5
 *
 * The complete map for DMA kick reg using use all queue is:
 * static const int rtl8187se_queues_map[RTL8187SE_NR_TX_QUEUES] =
 *	{1, 6, 5, 4, 3, 2, 7};
 *
 * .. but.. Because for mac80211 4 queues are enough for QoS we use this
 *
 * name | reg  |  queue
 *  BC  |  7   |   4  <- currently not used yet
 *  MG  |  1   |   x  <- Not used
 *  HI  |  6   |   x  <- Not used
 *  VO  |  5   |   0  <- used
 *  VI  |  4   |   1  <- used
 *  BE  |  3   |   2  <- used
 *  BK  |  2   |   3  <- used
 *
 * Beacon queue could be used, but this is not finished yet.
 *
 * I thougth about using the other two queues but I decided not to do this:
 *
 * - I'm unsure whether the mac80211 will ever try to use more than 4 queues
 *   by itself.
 *
 * - I could route MGMT frames (currently sent over VO queue) to the MGMT
 *   queue but since mac80211 will do not know about it, I will probably gain
 *   some HW priority whenever the VO queue is not empty, but this gain is
 *   limited by the fact that I had to stop the mac80211 queue whenever one of
 *   the VO or MGMT queues is full, stopping also submitting of MGMT frame
 *   to the driver.
 *
 * - I don't know how to set in the HW the contention window params for MGMT
 *   and HI-prio queues.
 */

static const int rtl8187se_queues_map[RTL8187SE_NR_TX_QUEUES] =;

/* Queues for rtl8180/rtl8185 cards
 *
 * name | reg  |  prio
 *  BC  |  7   |   3
 *  HI  |  6   |   0
 *  NO  |  5   |   1
 *  LO  |  4   |   2
 *
 * The complete map for DMA kick reg using all queue is:
 * static const int rtl8180_queues_map[RTL8180_NR_TX_QUEUES] = {6, 5, 4, 7};
 *
 * .. but .. Because the mac80211 needs at least 4 queues for QoS or
 * otherwise QoS can't be done, we use just one.
 * Beacon queue could be used, but this is not finished yet.
 * Actual map is:
 *
 * name | reg  |  prio
 *  BC  |  7   |   1  <- currently not used yet.
 *  HI  |  6   |   x  <- not used
 *  NO  |  5   |   x  <- not used
 *  LO  |  4   |   0  <- used
 */

static const int rtl8180_queues_map[RTL8180_NR_TX_QUEUES] =;

/* LNA gain table for rtl8187se */
static const u8 rtl8187se_lna_gain[4] =;

void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)
{}

static void rtl8180_handle_rx(struct ieee80211_hw *dev)
{}

static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio)
{}

static irqreturn_t rtl8187se_interrupt(int irq, void *dev_id)
{}

static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
{}

static void rtl8180_tx(struct ieee80211_hw *dev,
		       struct ieee80211_tx_control *control,
		       struct sk_buff *skb)
{}

static void rtl8180_set_anaparam3(struct rtl8180_priv *priv, u16 anaparam3)
{}

void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2)
{}

void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam)
{}

static void rtl8187se_mac_config(struct ieee80211_hw *dev)
{}

static void rtl8187se_set_antenna_config(struct ieee80211_hw *dev, u8 def_ant,
					 bool diversity)
{}

static void rtl8180_int_enable(struct ieee80211_hw *dev)
{}

static void rtl8180_int_disable(struct ieee80211_hw *dev)
{}

static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev,
			    u32 basic_mask)
{}

static void rtl8180_config_cardbus(struct ieee80211_hw *dev)
{}

static int rtl8180_init_hw(struct ieee80211_hw *dev)
{}

static int rtl8180_init_rx_ring(struct ieee80211_hw *dev)
{}

static void rtl8180_free_rx_ring(struct ieee80211_hw *dev)
{}

static int rtl8180_init_tx_ring(struct ieee80211_hw *dev,
				unsigned int prio, unsigned int entries)
{}

static void rtl8180_free_tx_ring(struct ieee80211_hw *dev, unsigned int prio)
{}

static int rtl8180_start(struct ieee80211_hw *dev)
{}

static void rtl8180_stop(struct ieee80211_hw *dev, bool suspend)
{}

static u64 rtl8180_get_tsf(struct ieee80211_hw *dev,
			   struct ieee80211_vif *vif)
{}

static void rtl8180_beacon_work(struct work_struct *work)
{}

static int rtl8180_add_interface(struct ieee80211_hw *dev,
				 struct ieee80211_vif *vif)
{}

static void rtl8180_remove_interface(struct ieee80211_hw *dev,
				     struct ieee80211_vif *vif)
{}

static int rtl8180_config(struct ieee80211_hw *dev, u32 changed)
{}

static void rtl8187se_conf_ac_parm(struct ieee80211_hw *dev, u8 queue)
{}

static int rtl8180_conf_tx(struct ieee80211_hw *dev,
			    struct ieee80211_vif *vif,
			    unsigned int link_id, u16 queue,
			    const struct ieee80211_tx_queue_params *params)
{}

static void rtl8180_conf_erp(struct ieee80211_hw *dev,
			    struct ieee80211_bss_conf *info)
{}

static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,
				     struct ieee80211_vif *vif,
				     struct ieee80211_bss_conf *info,
				     u64 changed)
{}

static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev,
				     struct netdev_hw_addr_list *mc_list)
{}

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

static const struct ieee80211_ops rtl8180_ops =;

static void rtl8180_eeprom_register_read(struct eeprom_93cx6 *eeprom)
{}

static void rtl8180_eeprom_register_write(struct eeprom_93cx6 *eeprom)
{}

static void rtl8180_eeprom_read(struct rtl8180_priv *priv)
{}

static int rtl8180_probe(struct pci_dev *pdev,
				   const struct pci_device_id *id)
{}

static void rtl8180_remove(struct pci_dev *pdev)
{}

#define rtl8180_suspend
#define rtl8180_resume

static SIMPLE_DEV_PM_OPS(rtl8180_pm_ops, rtl8180_suspend, rtl8180_resume);

static struct pci_driver rtl8180_driver =;

module_pci_driver();