linux/drivers/net/wireless/ralink/rt2x00/rt2500usb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
	Copyright (C) 2004 - 2009 Ivo van Doorn <[email protected]>
	<http://rt2x00.serialmonkey.com>

 */

/*
	Module: rt2500usb
	Abstract: rt2500usb device specific routines.
	Supported chipsets: RT2570.
 */

#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>

#include "rt2x00.h"
#include "rt2x00usb.h"
#include "rt2500usb.h"

/*
 * Allow hardware encryption to be disabled.
 */
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, 0444);
MODULE_PARM_DESC();

/*
 * Register access.
 * All access to the CSR registers will go through the methods
 * rt2500usb_register_read and rt2500usb_register_write.
 * BBP and RF register require indirect register access,
 * and use the CSR registers BBPCSR and RFCSR to achieve this.
 * These indirect registers work with busy bits,
 * and we will try maximal REGISTER_USB_BUSY_COUNT times to access
 * the register while taking a REGISTER_BUSY_DELAY us delay
 * between each attampt. When the busy bit is still set at that time,
 * the access attempt is considered to have failed,
 * and we will print an error.
 * If the csr_mutex is already held then the _lock variants must
 * be used instead.
 */
static u16 rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
				   const unsigned int offset)
{}

static u16 rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
					const unsigned int offset)
{}

static void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
					    const unsigned int offset,
					    u16 value)
{}

static void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev,
						 const unsigned int offset,
						 u16 value)
{}

static void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,
						 const unsigned int offset,
						 void *value, const u16 length)
{}

static int rt2500usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
				  const unsigned int offset,
				  struct rt2x00_field16 field,
				  u16 *reg)
{}

#define WAIT_FOR_BBP(__dev, __reg)
#define WAIT_FOR_RF(__dev, __reg)

static void rt2500usb_bbp_write(struct rt2x00_dev *rt2x00dev,
				const unsigned int word, const u8 value)
{}

static u8 rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
			     const unsigned int word)
{}

static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev,
			       const unsigned int word, const u32 value)
{}

#ifdef CONFIG_RT2X00_LIB_DEBUGFS
static u32 _rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
				     const unsigned int offset)
{}

static void _rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
				      const unsigned int offset,
				      u32 value)
{}

static const struct rt2x00debug rt2500usb_rt2x00debug =;
#endif /* CONFIG_RT2X00_LIB_DEBUGFS */

static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev)
{}

#ifdef CONFIG_RT2X00_LIB_LEDS
static void rt2500usb_brightness_set(struct led_classdev *led_cdev,
				     enum led_brightness brightness)
{}

static int rt2500usb_blink_set(struct led_classdev *led_cdev,
			       unsigned long *delay_on,
			       unsigned long *delay_off)
{}

static void rt2500usb_init_led(struct rt2x00_dev *rt2x00dev,
			       struct rt2x00_led *led,
			       enum led_type type)
{}
#endif /* CONFIG_RT2X00_LIB_LEDS */

/*
 * Configuration handlers.
 */

/*
 * rt2500usb does not differentiate between shared and pairwise
 * keys, so we should use the same function for both key types.
 */
static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
				struct rt2x00lib_crypto *crypto,
				struct ieee80211_key_conf *key)
{}

static void rt2500usb_config_filter(struct rt2x00_dev *rt2x00dev,
				    const unsigned int filter_flags)
{}

static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev,
				  struct rt2x00_intf *intf,
				  struct rt2x00intf_conf *conf,
				  const unsigned int flags)
{}

static void rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev,
				 struct rt2x00lib_erp *erp,
				 u32 changed)
{}

static void rt2500usb_config_ant(struct rt2x00_dev *rt2x00dev,
				 struct antenna_setup *ant)
{}

static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev,
				     struct rf_channel *rf, const int txpower)
{}

static void rt2500usb_config_txpower(struct rt2x00_dev *rt2x00dev,
				     const int txpower)
{}

static void rt2500usb_config_ps(struct rt2x00_dev *rt2x00dev,
				struct rt2x00lib_conf *libconf)
{}

static void rt2500usb_config(struct rt2x00_dev *rt2x00dev,
			     struct rt2x00lib_conf *libconf,
			     const unsigned int flags)
{}

/*
 * Link tuning
 */
static void rt2500usb_link_stats(struct rt2x00_dev *rt2x00dev,
				 struct link_qual *qual)
{}

static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev,
				  struct link_qual *qual)
{}

/*
 * Queue handlers.
 */
static void rt2500usb_start_queue(struct data_queue *queue)
{}

static void rt2500usb_stop_queue(struct data_queue *queue)
{}

/*
 * Initialization functions.
 */
static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
{}

static int rt2500usb_wait_bbp_ready(struct rt2x00_dev *rt2x00dev)
{}

static int rt2500usb_init_bbp(struct rt2x00_dev *rt2x00dev)
{}

/*
 * Device state switch handlers.
 */
static int rt2500usb_enable_radio(struct rt2x00_dev *rt2x00dev)
{}

static void rt2500usb_disable_radio(struct rt2x00_dev *rt2x00dev)
{}

static int rt2500usb_set_state(struct rt2x00_dev *rt2x00dev,
			       enum dev_state state)
{}

static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
				      enum dev_state state)
{}

/*
 * TX descriptor initialization
 */
static void rt2500usb_write_tx_desc(struct queue_entry *entry,
				    struct txentry_desc *txdesc)
{}

/*
 * TX data initialization
 */
static void rt2500usb_beacondone(struct urb *urb);

static void rt2500usb_write_beacon(struct queue_entry *entry,
				   struct txentry_desc *txdesc)
{}

static int rt2500usb_get_tx_data_len(struct queue_entry *entry)
{}

/*
 * RX control handlers
 */
static void rt2500usb_fill_rxdone(struct queue_entry *entry,
				  struct rxdone_entry_desc *rxdesc)
{}

/*
 * Interrupt functions.
 */
static void rt2500usb_beacondone(struct urb *urb)
{}

/*
 * Device probe functions.
 */
static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
{}

static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
{}

/*
 * RF value list for RF2522
 * Supports: 2.4 GHz
 */
static const struct rf_channel rf_vals_bg_2522[] =;

/*
 * RF value list for RF2523
 * Supports: 2.4 GHz
 */
static const struct rf_channel rf_vals_bg_2523[] =;

/*
 * RF value list for RF2524
 * Supports: 2.4 GHz
 */
static const struct rf_channel rf_vals_bg_2524[] =;

/*
 * RF value list for RF2525
 * Supports: 2.4 GHz
 */
static const struct rf_channel rf_vals_bg_2525[] =;

/*
 * RF value list for RF2525e
 * Supports: 2.4 GHz
 */
static const struct rf_channel rf_vals_bg_2525e[] =;

/*
 * RF value list for RF5222
 * Supports: 2.4 GHz & 5.2 GHz
 */
static const struct rf_channel rf_vals_5222[] =;

static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
{}

static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
{}

static const struct ieee80211_ops rt2500usb_mac80211_ops =;

static const struct rt2x00lib_ops rt2500usb_rt2x00_ops =;

static void rt2500usb_queue_init(struct data_queue *queue)
{}

static const struct rt2x00_ops rt2500usb_ops =;

/*
 * rt2500usb module information.
 */
static const struct usb_device_id rt2500usb_device_table[] =;

MODULE_AUTHOR();
MODULE_VERSION();
MODULE_DESCRIPTION();
MODULE_DEVICE_TABLE(usb, rt2500usb_device_table);
MODULE_LICENSE();

static int rt2500usb_probe(struct usb_interface *usb_intf,
			   const struct usb_device_id *id)
{}

static struct usb_driver rt2500usb_driver =;

module_usb_driver();