linux/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c

/*
 * Copyright (c) 2010 Broadcom Corporation
 * Copyright (c) 2013 Hauke Mehrtens <[email protected]>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#define __UNDEF_NO_VERSION__
#define pr_fmt(fmt)

#include <linux/etherdevice.h>
#include <linux/sched.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/bcma/bcma.h>
#include <net/mac80211.h>
#include <defs.h>
#include "phy/phy_int.h"
#include "d11.h"
#include "channel.h"
#include "scb.h"
#include "pub.h"
#include "ucode_loader.h"
#include "mac80211_if.h"
#include "main.h"
#include "debug.h"
#include "led.h"

#define N_TX_QUEUES
#define BRCMS_FLUSH_TIMEOUT

/* Flags we support */
#define MAC_FILTERS

#define CHAN2GHZ(channel, freqency, chflags)

#define CHAN5GHZ(channel, chflags)

#define RATE(rate100m, _flags)

struct firmware_hdr {};

static const char * const brcms_firmwares[MAX_FW_IMAGES] =;

static int n_adapters_found;

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
/* This needs to be adjusted when brcms_firmwares changes */
MODULE_FIRMWARE();
MODULE_FIRMWARE();

/* recognized BCMA Core IDs */
static struct bcma_device_id brcms_coreid_table[] =;
MODULE_DEVICE_TABLE(bcma, brcms_coreid_table);

#if defined(CONFIG_BRCMDBG)
/*
 * Module parameter for setting the debug message level. Available
 * flags are specified by the BRCM_DL_* macros in
 * drivers/net/wireless/brcm80211/include/defs.h.
 */
module_param_named(debug, brcm_msg_level, uint, 0644);
#endif

static struct ieee80211_channel brcms_2ghz_chantable[] =;

static struct ieee80211_channel brcms_5ghz_nphy_chantable[] =;

/*
 * The rate table is used for both 2.4G and 5G rates. The
 * latter being a subset as it does not support CCK rates.
 */
static struct ieee80211_rate legacy_ratetable[] =;

static const struct ieee80211_supported_band brcms_band_2GHz_nphy_template =;

static const struct ieee80211_supported_band brcms_band_5GHz_nphy_template =;

/* flags the given rate in rateset as requested */
static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br)
{}

/*
 * This function frees the WL per-device resources.
 *
 * This function frees resources owned by the WL device pointed to
 * by the wl parameter.
 *
 * precondition: can both be called locked and unlocked
 */
static void brcms_free(struct brcms_info *wl)
{}

/*
* called from both kernel as from this kernel module (error flow on attach)
* precondition: perimeter lock is not acquired.
*/
static void brcms_remove(struct bcma_device *pdev)
{}

/*
 * Precondition: Since this function is called in brcms_pci_probe() context,
 * no locking is required.
 */
static void brcms_release_fw(struct brcms_info *wl)
{}

/*
 * Precondition: Since this function is called in brcms_pci_probe() context,
 * no locking is required.
 */
static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev)
{}

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

static int brcms_ops_start(struct ieee80211_hw *hw)
{}

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

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

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

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

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

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

static void brcms_ops_sw_scan_start(struct ieee80211_hw *hw,
				    struct ieee80211_vif *vif,
				    const u8 *mac_addr)
{}

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

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

static int
brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	       struct ieee80211_sta *sta)
{}

static int
brcms_ops_ampdu_action(struct ieee80211_hw *hw,
		    struct ieee80211_vif *vif,
		    struct ieee80211_ampdu_params *params)
{}

static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
{}

static bool brcms_tx_flush_completed(struct brcms_info *wl)
{}

static void brcms_ops_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			    u32 queues, bool drop)
{}

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

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

static int brcms_ops_beacon_set_tim(struct ieee80211_hw *hw,
				 struct ieee80211_sta *sta, bool set)
{}

static const struct ieee80211_ops brcms_ops =;

void brcms_dpc(struct tasklet_struct *t)
{}

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

/*
 * is called in brcms_pci_probe() context, therefore no locking required.
 */
static int ieee_hw_rate_init(struct ieee80211_hw *hw)
{}

/*
 * is called in brcms_pci_probe() context, therefore no locking required.
 */
static int ieee_hw_init(struct ieee80211_hw *hw)
{}

/*
 * attach to the WL device.
 *
 * Attach to the WL device identified by vendor and device parameters.
 * regs is a host accessible memory address pointing to WL device registers.
 *
 * is called in brcms_bcma_probe() context, therefore no locking required.
 */
static struct brcms_info *brcms_attach(struct bcma_device *pdev)
{}



/*
 * determines if a device is a WL device, and if so, attaches it.
 *
 * This function determines if a device pointed to by pdev is a WL device,
 * and if so, performs a brcms_attach() on it.
 *
 * Perimeter lock is initialized in the course of this function.
 */
static int brcms_bcma_probe(struct bcma_device *pdev)
{}

static int brcms_suspend(struct bcma_device *pdev)
{}

static int brcms_resume(struct bcma_device *pdev)
{}

static struct bcma_driver brcms_bcma_driver =;

/*
 * This is the main entry point for the brcmsmac driver.
 *
 * This function is scheduled upon module initialization and
 * does the driver registration, which result in brcms_bcma_probe()
 * call resulting in the driver bringup.
 */
static void brcms_driver_init(struct work_struct *work)
{}

static DECLARE_WORK(brcms_driver_work, brcms_driver_init);

static int __init brcms_module_init(void)
{}

/*
 * This function unloads the brcmsmac driver from the system.
 *
 * This function unconditionally unloads the brcmsmac driver module from the
 * system.
 *
 */
static void __exit brcms_module_exit(void)
{}

module_init();
module_exit(brcms_module_exit);

/*
 * precondition: perimeter lock has been acquired
 */
void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
			 bool state, int prio)
{}

/*
 * precondition: perimeter lock has been acquired
 */
void brcms_init(struct brcms_info *wl)
{}

/*
 * precondition: perimeter lock has been acquired
 */
uint brcms_reset(struct brcms_info *wl)
{}

void brcms_fatal_error(struct brcms_info *wl)
{}

/*
 * These are interrupt on/off entry points. Disable interrupts
 * during interrupt state transition.
 */
void brcms_intrson(struct brcms_info *wl)
{}

u32 brcms_intrsoff(struct brcms_info *wl)
{}

void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask)
{}

/*
 * precondition: perimeter lock has been acquired
 */
int brcms_up(struct brcms_info *wl)
{}

/*
 * precondition: perimeter lock has been acquired
 */
void brcms_down(struct brcms_info *wl)
	__must_hold(&wl->lock)
{}

/*
* precondition: perimeter lock is not acquired
 */
static void _brcms_timer(struct work_struct *work)
{}

/*
 * Adds a timer to the list. Caller supplies a timer function.
 * Is called from wlc.
 *
 * precondition: perimeter lock has been acquired
 */
struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
				     void (*fn) (void *arg),
				     void *arg, const char *name)
{}

/*
 * adds only the kernel timer since it's going to be more accurate
 * as well as it's easier to make it periodic
 *
 * precondition: perimeter lock has been acquired
 */
void brcms_add_timer(struct brcms_timer *t, uint ms, int periodic)
{}

/*
 * return true if timer successfully deleted, false if still pending
 *
 * precondition: perimeter lock has been acquired
 */
bool brcms_del_timer(struct brcms_timer *t)
{}

/*
 * precondition: perimeter lock has been acquired
 */
void brcms_free_timer(struct brcms_timer *t)
{}

/*
 * precondition: no locking required
 */
int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
{}

/*
 * Precondition: Since this function is called in brcms_bcma_probe() context,
 * no locking is required.
 */
int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes, u32 idx)
{}

/*
 * precondition: can both be called locked and unlocked
 */
void brcms_ucode_free_buf(void *p)
{}

/*
 * checks validity of all firmware images loaded from user space
 *
 * Precondition: Since this function is called in brcms_bcma_probe() context,
 * no locking is required.
 */
int brcms_check_firmwares(struct brcms_info *wl)
{}

/*
 * precondition: perimeter lock has been acquired
 */
bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
	__must_hold(&wl->lock)
{}