#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/ieee80211_radiotap.h>
#include <net/mac80211.h>
#include <asm/div64.h>
#define DRV_NAME …
#include "commands.h"
#include "common.h"
#include "3945.h"
#include "iwl-spectrum.h"
#define DRV_DESCRIPTION …
#ifdef CONFIG_IWLEGACY_DEBUG
#define VD …
#else
#define VD
#endif
#define DRV_VERSION …
#define DRV_COPYRIGHT …
#define DRV_AUTHOR …
MODULE_DESCRIPTION(…);
MODULE_VERSION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
struct il_mod_params il3945_mod_params = …;
__le32
il3945_get_antenna_flags(const struct il_priv *il)
{ … }
static int
il3945_set_ccmp_dynamic_key_info(struct il_priv *il,
struct ieee80211_key_conf *keyconf, u8 sta_id)
{ … }
static int
il3945_set_tkip_dynamic_key_info(struct il_priv *il,
struct ieee80211_key_conf *keyconf, u8 sta_id)
{ … }
static int
il3945_set_wep_dynamic_key_info(struct il_priv *il,
struct ieee80211_key_conf *keyconf, u8 sta_id)
{ … }
static int
il3945_clear_sta_key_info(struct il_priv *il, u8 sta_id)
{ … }
static int
il3945_set_dynamic_key(struct il_priv *il, struct ieee80211_key_conf *keyconf,
u8 sta_id)
{ … }
static int
il3945_remove_static_key(struct il_priv *il)
{ … }
static int
il3945_set_static_key(struct il_priv *il, struct ieee80211_key_conf *key)
{ … }
static void
il3945_clear_free_frames(struct il_priv *il)
{ … }
static struct il3945_frame *
il3945_get_free_frame(struct il_priv *il)
{ … }
static void
il3945_free_frame(struct il_priv *il, struct il3945_frame *frame)
{ … }
unsigned int
il3945_fill_beacon_frame(struct il_priv *il, struct ieee80211_hdr *hdr,
int left)
{ … }
static int
il3945_send_beacon_cmd(struct il_priv *il)
{ … }
static void
il3945_unset_hw_params(struct il_priv *il)
{ … }
static void
il3945_build_tx_cmd_hwcrypto(struct il_priv *il, struct ieee80211_tx_info *info,
struct il_device_cmd *cmd,
struct sk_buff *skb_frag, int sta_id)
{ … }
static void
il3945_build_tx_cmd_basic(struct il_priv *il, struct il_device_cmd *cmd,
struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr, u8 std_id)
{ … }
static int
il3945_tx_skb(struct il_priv *il,
struct ieee80211_sta *sta,
struct sk_buff *skb)
{ … }
static int
il3945_get_measurement(struct il_priv *il,
struct ieee80211_measurement_params *params, u8 type)
{ … }
static void
il3945_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb)
{ … }
static void
il3945_hdl_add_sta(struct il_priv *il, struct il_rx_buf *rxb)
{ … }
static void
il3945_hdl_beacon(struct il_priv *il, struct il_rx_buf *rxb)
{ … }
static void
il3945_hdl_card_state(struct il_priv *il, struct il_rx_buf *rxb)
{ … }
static void
il3945_setup_handlers(struct il_priv *il)
{ … }
static inline __le32
il3945_dma_addr2rbd_ptr(struct il_priv *il, dma_addr_t dma_addr)
{ … }
static void
il3945_rx_queue_restock(struct il_priv *il)
{ … }
static void
il3945_rx_allocate(struct il_priv *il, gfp_t priority)
{ … }
void
il3945_rx_queue_reset(struct il_priv *il, struct il_rx_queue *rxq)
{ … }
void
il3945_rx_replenish(void *data)
{ … }
static void
il3945_rx_replenish_now(struct il_priv *il)
{ … }
static void
il3945_rx_queue_free(struct il_priv *il, struct il_rx_queue *rxq)
{ … }
static u8 ratio2dB[100] = …;
int
il3945_calc_db_from_ratio(int sig_ratio)
{ … }
static void
il3945_rx_handle(struct il_priv *il)
{ … }
static inline void
il3945_synchronize_irq(struct il_priv *il)
{ … }
static const char *
il3945_desc_lookup(int i)
{ … }
#define ERROR_START_OFFSET …
#define ERROR_ELEM_SIZE …
void
il3945_dump_nic_error_log(struct il_priv *il)
{ … }
static void
il3945_irq_tasklet(struct tasklet_struct *t)
{ … }
static int
il3945_get_channels_for_scan(struct il_priv *il, enum nl80211_band band,
u8 is_active, u8 n_probes,
struct il3945_scan_channel *scan_ch,
struct ieee80211_vif *vif)
{ … }
static void
il3945_init_hw_rates(struct il_priv *il, struct ieee80211_rate *rates)
{ … }
static void
il3945_dealloc_ucode_pci(struct il_priv *il)
{ … }
static int
il3945_verify_inst_full(struct il_priv *il, __le32 * image, u32 len)
{ … }
static int
il3945_verify_inst_sparse(struct il_priv *il, __le32 * image, u32 len)
{ … }
static int
il3945_verify_ucode(struct il_priv *il)
{ … }
static void
il3945_nic_start(struct il_priv *il)
{ … }
#define IL3945_UCODE_GET(item) …
static u32
il3945_ucode_get_header_size(u32 api_ver)
{ … }
static u8 *
il3945_ucode_get_data(const struct il_ucode_header *ucode)
{ … }
IL3945_UCODE_GET(inst_size);
IL3945_UCODE_GET(data_size);
IL3945_UCODE_GET(init_size);
IL3945_UCODE_GET(init_data_size);
IL3945_UCODE_GET(boot_size);
static int
il3945_read_ucode(struct il_priv *il)
{ … }
static int
il3945_set_ucode_ptrs(struct il_priv *il)
{ … }
static void
il3945_init_alive_start(struct il_priv *il)
{ … }
static void
il3945_alive_start(struct il_priv *il)
{ … }
static void il3945_cancel_deferred_work(struct il_priv *il);
static void
__il3945_down(struct il_priv *il)
{ … }
static void
il3945_down(struct il_priv *il)
{ … }
#define MAX_HW_RESTARTS …
static int
il3945_alloc_bcast_station(struct il_priv *il)
{ … }
static int
__il3945_up(struct il_priv *il)
{ … }
static void
il3945_bg_init_alive_start(struct work_struct *data)
{ … }
static void
il3945_bg_alive_start(struct work_struct *data)
{ … }
static void
il3945_rfkill_poll(struct work_struct *data)
{ … }
int
il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
{ … }
void
il3945_post_scan(struct il_priv *il)
{ … }
static void
il3945_bg_restart(struct work_struct *data)
{ … }
static void
il3945_bg_rx_replenish(struct work_struct *data)
{ … }
void
il3945_post_associate(struct il_priv *il)
{ … }
#define UCODE_READY_TIMEOUT …
static int
il3945_mac_start(struct ieee80211_hw *hw)
{ … }
static void
il3945_mac_stop(struct ieee80211_hw *hw, bool suspend)
{ … }
static void
il3945_mac_tx(struct ieee80211_hw *hw,
struct ieee80211_tx_control *control,
struct sk_buff *skb)
{ … }
void
il3945_config_ap(struct il_priv *il)
{ … }
static int
il3945_mac_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
il3945_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{ … }
static void
il3945_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
unsigned int *total_flags, u64 multicast)
{ … }
#ifdef CONFIG_IWLEGACY_DEBUG
static ssize_t
il3945_show_debug_level(struct device *d, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
il3945_store_debug_level(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(debug_level, 0644, il3945_show_debug_level,
il3945_store_debug_level);
#endif
static ssize_t
il3945_show_temperature(struct device *d, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(temperature, 0444, il3945_show_temperature, NULL);
static ssize_t
il3945_show_tx_power(struct device *d, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
il3945_store_tx_power(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(tx_power, 0644, il3945_show_tx_power, il3945_store_tx_power);
static ssize_t
il3945_show_flags(struct device *d, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
il3945_store_flags(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(flags, 0644, il3945_show_flags, il3945_store_flags);
static ssize_t
il3945_show_filter_flags(struct device *d, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
il3945_store_filter_flags(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(filter_flags, 0644, il3945_show_filter_flags,
il3945_store_filter_flags);
static ssize_t
il3945_show_measurement(struct device *d, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
il3945_store_measurement(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(measurement, 0600, il3945_show_measurement,
il3945_store_measurement);
static ssize_t
il3945_store_retry_rate(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
il3945_show_retry_rate(struct device *d, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(retry_rate, 0600, il3945_show_retry_rate,
il3945_store_retry_rate);
static ssize_t
il3945_show_channels(struct device *d, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(channels, 0400, il3945_show_channels, NULL);
static ssize_t
il3945_show_antenna(struct device *d, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
il3945_store_antenna(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(antenna, 0644, il3945_show_antenna, il3945_store_antenna);
static ssize_t
il3945_show_status(struct device *d, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(status, 0444, il3945_show_status, NULL);
static ssize_t
il3945_dump_error_log(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(dump_errors, 0200, NULL, il3945_dump_error_log);
static int
il3945_setup_deferred_work(struct il_priv *il)
{ … }
static void
il3945_cancel_deferred_work(struct il_priv *il)
{ … }
static struct attribute *il3945_sysfs_entries[] = …;
static const struct attribute_group il3945_attribute_group = …;
static struct ieee80211_ops il3945_mac_ops __ro_after_init = …;
static int
il3945_init_drv(struct il_priv *il)
{ … }
#define IL3945_MAX_PROBE_REQUEST …
static int
il3945_setup_mac(struct il_priv *il)
{ … }
static int
il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void
il3945_pci_remove(struct pci_dev *pdev)
{ … }
static struct pci_driver il3945_driver = …;
static int __init
il3945_init(void)
{ … }
static void __exit
il3945_exit(void)
{ … }
MODULE_FIRMWARE(…);
module_param_named(antenna, il3945_mod_params.antenna, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(swcrypto, il3945_mod_params.sw_crypto, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(disable_hw_scan, il3945_mod_params.disable_hw_scan, int,
0444);
MODULE_PARM_DESC(…) …;
#ifdef CONFIG_IWLEGACY_DEBUG
module_param_named(debug, il_debug_level, uint, 0644);
MODULE_PARM_DESC(…) …;
#endif
module_param_named(fw_restart, il3945_mod_params.restart_fw, int, 0444);
MODULE_PARM_DESC(…) …;
module_exit(il3945_exit);
module_init(…) …;