linux/drivers/net/wireless/zydas/zd1211rw/zd_mac.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* ZD1211 USB-WLAN driver for Linux
 *
 * Copyright (C) 2005-2007 Ulrich Kunitz <[email protected]>
 * Copyright (C) 2006-2007 Daniel Drake <[email protected]>
 * Copyright (C) 2006-2007 Michael Wu <[email protected]>
 * Copyright (C) 2007-2008 Luis R. Rodriguez <[email protected]>
 */

#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/jiffies.h>
#include <net/ieee80211_radiotap.h>

#include "zd_def.h"
#include "zd_chip.h"
#include "zd_mac.h"
#include "zd_rf.h"

struct zd_reg_alpha2_map {};

static struct zd_reg_alpha2_map reg_alpha2_map[] =;

/* This table contains the hardware specific values for the modulation rates. */
static const struct ieee80211_rate zd_rates[] =;

/*
 * Zydas retry rates table. Each line is listed in the same order as
 * in zd_rates[] and contains all the rate used when a packet is sent
 * starting with a given rates. Let's consider an example :
 *
 * "11 Mbits : 4, 3, 2, 1, 0" means :
 * - packet is sent using 4 different rates
 * - 1st rate is index 3 (ie 11 Mbits)
 * - 2nd rate is index 2 (ie 5.5 Mbits)
 * - 3rd rate is index 1 (ie 2 Mbits)
 * - 4th rate is index 0 (ie 1 Mbits)
 */

static const struct tx_retry_rate zd_retry_rates[] =;

static const struct ieee80211_channel zd_channels[] =;

static void housekeeping_init(struct zd_mac *mac);
static void housekeeping_enable(struct zd_mac *mac);
static void housekeeping_disable(struct zd_mac *mac);
static void beacon_init(struct zd_mac *mac);
static void beacon_enable(struct zd_mac *mac);
static void beacon_disable(struct zd_mac *mac);
static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble);
static int zd_mac_config_beacon(struct ieee80211_hw *hw,
				struct sk_buff *beacon, bool in_intr);

static int zd_reg2alpha2(u8 regdomain, char *alpha2)
{}

static int zd_check_signal(struct ieee80211_hw *hw, int signal)
{}

int zd_mac_preinit_hw(struct ieee80211_hw *hw)
{}

int zd_mac_init_hw(struct ieee80211_hw *hw)
{}

void zd_mac_clear(struct zd_mac *mac)
{}

static int set_rx_filter(struct zd_mac *mac)
{}

static int set_mac_and_bssid(struct zd_mac *mac)
{}

static int set_mc_hash(struct zd_mac *mac)
{}

int zd_op_start(struct ieee80211_hw *hw)
{}

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

int zd_restore_settings(struct zd_mac *mac)
{}

/**
 * zd_mac_tx_status - reports tx status of a packet if required
 * @hw: a &struct ieee80211_hw pointer
 * @skb: a sk-buffer
 * @ackssi: ACK signal strength
 * @tx_status: success and/or retry
 *
 * This information calls ieee80211_tx_status_irqsafe() if required by the
 * control information. It copies the control information into the status
 * information.
 *
 * If no status information has been requested, the skb is freed.
 */
static void zd_mac_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
		      int ackssi, struct tx_status *tx_status)
{}

/**
 * zd_mac_tx_failed - callback for failed frames
 * @urb: pointer to the urb structure
 *
 * This function is called if a frame couldn't be successfully
 * transferred. The first frame from the tx queue, will be selected and
 * reported as error to the upper layers.
 */
void zd_mac_tx_failed(struct urb *urb)
{}

/**
 * zd_mac_tx_to_dev - callback for USB layer
 * @skb: a &sk_buff pointer
 * @error: error value, 0 if transmission successful
 *
 * Informs the MAC layer that the frame has successfully transferred to the
 * device. If an ACK is required and the transfer to the device has been
 * successful, the packets are put on the @ack_wait_queue with
 * the control set removed.
 */
void zd_mac_tx_to_dev(struct sk_buff *skb, int error)
{}

static int zd_calc_tx_length_us(u8 *service, u8 zd_rate, u16 tx_length)
{}

static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
	                   struct ieee80211_hdr *header,
	                   struct ieee80211_tx_info *info)
{}

static bool zd_mac_match_cur_beacon(struct zd_mac *mac, struct sk_buff *beacon)
{}

static void zd_mac_free_cur_beacon_locked(struct zd_mac *mac)
{}

static void zd_mac_free_cur_beacon(struct zd_mac *mac)
{}

static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon,
				bool in_intr)
{}

static int fill_ctrlset(struct zd_mac *mac,
			struct sk_buff *skb)
{}

/**
 * zd_op_tx - transmits a network frame to the device
 *
 * @hw: a &struct ieee80211_hw pointer
 * @control: the control structure
 * @skb: socket buffer
 *
 * This function transmit an IEEE 802.11 network frame to the device. The
 * control block of the skbuff will be initialized. If necessary the incoming
 * mac80211 queues will be stopped.
 */
static void zd_op_tx(struct ieee80211_hw *hw,
		     struct ieee80211_tx_control *control,
		     struct sk_buff *skb)
{}

/**
 * filter_ack - filters incoming packets for acknowledgements
 * @hw: a &struct ieee80211_hw pointer
 * @rx_hdr: received header
 * @stats: the status for the received packet
 *
 * This functions looks for ACK packets and tries to match them with the
 * frames in the tx queue. If a match is found the frame will be dequeued and
 * the upper layers is informed about the successful transmission. If
 * mac80211 queues have been stopped and the number of frames still to be
 * transmitted is low the queues will be opened again.
 *
 * Returns 1 if the frame was an ACK, 0 if it was ignored.
 */
static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
		      struct ieee80211_rx_status *stats)
{}

int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
{}

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

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

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

static void zd_beacon_done(struct zd_mac *mac)
{}

static void zd_process_intr(struct work_struct *work)
{}


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

#define SUPPORTED_FIF_FLAGS
static void zd_op_configure_filter(struct ieee80211_hw *hw,
			unsigned int changed_flags,
			unsigned int *new_flags,
			u64 multicast)
{}

static void set_rts_cts(struct zd_mac *mac, unsigned int short_preamble)
{}

static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
				   struct ieee80211_vif *vif,
				   struct ieee80211_bss_conf *bss_conf,
				   u64 changes)
{}

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

static const struct ieee80211_ops zd_ops =;

struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
{}

#define BEACON_WATCHDOG_DELAY

static void beacon_watchdog_handler(struct work_struct *work)
{}

static void beacon_init(struct zd_mac *mac)
{}

static void beacon_enable(struct zd_mac *mac)
{}

static void beacon_disable(struct zd_mac *mac)
{}

#define LINK_LED_WORK_DELAY

static void link_led_handler(struct work_struct *work)
{}

static void housekeeping_init(struct zd_mac *mac)
{}

static void housekeeping_enable(struct zd_mac *mac)
{}

static void housekeeping_disable(struct zd_mac *mac)
{}