Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
carl9170.h File Reference
#include <linux/kernel.h>
#include <linux/firmware.h>
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/hw_random.h>
#include <net/cfg80211.h>
#include <net/mac80211.h>
#include <linux/usb.h>
#include "eeprom.h"
#include "wlan.h"
#include "hw.h"
#include "fwdesc.h"
#include "fwcmd.h"
#include "../regd.h"

Go to the source code of this file.

Data Structures

struct  carl9170_sta_tid
 
struct  carl9170_tx_queue_stats
 
struct  carl9170_vif
 
struct  carl9170_vif_info
 
struct  ar9170
 
struct  carl9170_bar_list_entry
 
struct  carl9170_ba_stats
 
struct  carl9170_sta_info
 
struct  carl9170_tx_info
 

Macros

#define CARL9170FW_NAME   "carl9170-1.fw"
 
#define PAYLOAD_MAX   (CARL9170_MAX_CMD_LEN / 4 - 1)
 
#define CARL9170_MAX_RX_BUFFER_SIZE   8192
 
#define CARL9170_NUM_TID   16
 
#define WME_BA_BMP_SIZE   64
 
#define CARL9170_TX_USER_RATE_TRIES   3
 
#define WME_AC_BE   2
 
#define WME_AC_BK   3
 
#define WME_AC_VI   1
 
#define WME_AC_VO   0
 
#define TID_TO_WME_AC(_tid)
 
#define SEQ_DIFF(_start, _seq)   (((_start) - (_seq)) & 0x0fff)
 
#define SEQ_PREV(_seq)   (((_seq) - 1) & 0x0fff)
 
#define SEQ_NEXT(_seq)   (((_seq) + 1) & 0x0fff)
 
#define BAW_WITHIN(_start, _bawsz, _seqno)   ((((_seqno) - (_start)) & 0xfff) < (_bawsz))
 
#define CARL9170_BAW_BITS   (2 * WME_BA_BMP_SIZE)
 
#define CARL9170_BAW_SIZE   (BITS_TO_LONGS(CARL9170_BAW_BITS))
 
#define CARL9170_BAW_LEN   (DIV_ROUND_UP(CARL9170_BAW_BITS, BITS_PER_BYTE))
 
#define CARL9170_QUEUE_TIMEOUT   256
 
#define CARL9170_BUMP_QUEUE   1000
 
#define CARL9170_TX_TIMEOUT   2500
 
#define CARL9170_JANITOR_DELAY   128
 
#define CARL9170_QUEUE_STUCK_TIMEOUT   5500
 
#define CARL9170_STAT_WORK   30000
 
#define CARL9170_NUM_TX_AGG_MAX   30
 
#define CARL9170_NUM_TX_LIMIT_HARD   ((AR9170_TXQ_DEPTH * 3) / 2)
 
#define CARL9170_NUM_TX_LIMIT_SOFT   (AR9170_TXQ_DEPTH)
 
#define AR9170_NUM_RX_URBS   16
 
#define AR9170_NUM_RX_URBS_MUL   2
 
#define AR9170_NUM_TX_URBS   8
 
#define AR9170_NUM_RX_URBS_POOL   (AR9170_NUM_RX_URBS_MUL * AR9170_NUM_RX_URBS)
 
#define CHK_DEV_STATE(a, s)   (((struct ar9170 *)a)->state >= (s))
 
#define IS_INITIALIZED(a)   (CHK_DEV_STATE(a, CARL9170_STOPPED))
 
#define IS_ACCEPTING_CMD(a)   (CHK_DEV_STATE(a, CARL9170_IDLE))
 
#define IS_STARTED(a)   (CHK_DEV_STATE(a, CARL9170_STARTED))
 

Enumerations

enum  carl9170_rf_init_mode { CARL9170_RFI_NONE, CARL9170_RFI_WARM, CARL9170_RFI_COLD }
 
enum  carl9170_device_state { CARL9170_UNKNOWN_STATE, CARL9170_STOPPED, CARL9170_IDLE, CARL9170_STARTED }
 
enum  carl9170_tid_state {
  CARL9170_TID_STATE_INVALID, CARL9170_TID_STATE_KILLED, CARL9170_TID_STATE_SHUTDOWN, CARL9170_TID_STATE_SUSPEND,
  CARL9170_TID_STATE_PROGRESS, CARL9170_TID_STATE_IDLE, CARL9170_TID_STATE_XMIT
}
 
enum  carl9170_device_features { CARL9170_WPS_BUTTON = BIT(0), CARL9170_ONE_LED = BIT(1) }
 
enum  carl9170_restart_reasons {
  CARL9170_RR_NO_REASON = 0, CARL9170_RR_FATAL_FIRMWARE_ERROR, CARL9170_RR_TOO_MANY_FIRMWARE_ERRORS, CARL9170_RR_WATCHDOG,
  CARL9170_RR_STUCK_TX, CARL9170_RR_UNRESPONSIVE_DEVICE, CARL9170_RR_COMMAND_TIMEOUT, CARL9170_RR_TOO_MANY_PHY_ERRORS,
  CARL9170_RR_LOST_RSP, CARL9170_RR_INVALID_RSP, CARL9170_RR_USER_REQUEST, __CARL9170_RR_LAST
}
 
enum  carl9170_erp_modes {
  CARL9170_ERP_INVALID, CARL9170_ERP_AUTO, CARL9170_ERP_MAC80211, CARL9170_ERP_OFF,
  CARL9170_ERP_CTS, CARL9170_ERP_RTS, __CARL9170_ERP_NUM
}
 
enum  carl9170_ps_off_override_reasons { PS_OFF_VIF = BIT(0), PS_OFF_BCN = BIT(1) }
 

Functions

voidcarl9170_alloc (size_t priv_size)
 
int carl9170_register (struct ar9170 *ar)
 
void carl9170_unregister (struct ar9170 *ar)
 
void carl9170_free (struct ar9170 *ar)
 
void carl9170_restart (struct ar9170 *ar, const enum carl9170_restart_reasons r)
 
void carl9170_ps_check (struct ar9170 *ar)
 
int carl9170_usb_open (struct ar9170 *ar)
 
void carl9170_usb_stop (struct ar9170 *ar)
 
void carl9170_usb_tx (struct ar9170 *ar, struct sk_buff *skb)
 
void carl9170_usb_handle_tx_err (struct ar9170 *ar)
 
int carl9170_exec_cmd (struct ar9170 *ar, const enum carl9170_cmd_oids, u32 plen, void *payload, u32 rlen, void *resp)
 
int __carl9170_exec_cmd (struct ar9170 *ar, struct carl9170_cmd *cmd, const bool free_buf)
 
int carl9170_usb_restart (struct ar9170 *ar)
 
void carl9170_usb_reset (struct ar9170 *ar)
 
int carl9170_init_mac (struct ar9170 *ar)
 
int carl9170_set_qos (struct ar9170 *ar)
 
int carl9170_update_multicast (struct ar9170 *ar, const u64 mc_hast)
 
int carl9170_mod_virtual_mac (struct ar9170 *ar, const unsigned int id, const u8 *mac)
 
int carl9170_set_operating_mode (struct ar9170 *ar)
 
int carl9170_set_beacon_timers (struct ar9170 *ar)
 
int carl9170_set_dyn_sifs_ack (struct ar9170 *ar)
 
int carl9170_set_rts_cts_rate (struct ar9170 *ar)
 
int carl9170_set_ampdu_settings (struct ar9170 *ar)
 
int carl9170_set_slot_time (struct ar9170 *ar)
 
int carl9170_set_mac_rates (struct ar9170 *ar)
 
int carl9170_set_hwretry_limit (struct ar9170 *ar, const u32 max_retry)
 
int carl9170_upload_key (struct ar9170 *ar, const u8 id, const u8 *mac, const u8 ktype, const u8 keyidx, const u8 *keydata, const int keylen)
 
int carl9170_disable_key (struct ar9170 *ar, const u8 id)
 
int carl9170_set_mac_tpc (struct ar9170 *ar, struct ieee80211_channel *channel)
 
void carl9170_rx (struct ar9170 *ar, void *buf, unsigned int len)
 
void carl9170_handle_command_response (struct ar9170 *ar, void *buf, u32 len)
 
void carl9170_op_tx (struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb)
 
void carl9170_tx_janitor (struct work_struct *work)
 
void carl9170_tx_process_status (struct ar9170 *ar, const struct carl9170_rsp *cmd)
 
void carl9170_tx_status (struct ar9170 *ar, struct sk_buff *skb, const bool success)
 
void carl9170_tx_callback (struct ar9170 *ar, struct sk_buff *skb)
 
void carl9170_tx_drop (struct ar9170 *ar, struct sk_buff *skb)
 
void carl9170_tx_scheduler (struct ar9170 *ar)
 
void carl9170_tx_get_skb (struct sk_buff *skb)
 
int carl9170_tx_put_skb (struct sk_buff *skb)
 
int carl9170_update_beacon (struct ar9170 *ar, const bool submit)
 
int carl9170_led_init (struct ar9170 *ar)
 
int carl9170_led_set_state (struct ar9170 *ar, const u32 led_state)
 
int carl9170_set_channel (struct ar9170 *ar, struct ieee80211_channel *channel, enum nl80211_channel_type bw, enum carl9170_rf_init_mode rfi)
 
int carl9170_get_noisefloor (struct ar9170 *ar)
 
int carl9170_parse_firmware (struct ar9170 *ar)
 

Variables

struct ieee80211_rate __carl9170_ratetable []
 
int modparam_noht
 

Macro Definition Documentation

#define AR9170_NUM_RX_URBS   16

Definition at line 193 of file carl9170.h.

#define AR9170_NUM_RX_URBS_MUL   2

Definition at line 194 of file carl9170.h.

#define AR9170_NUM_RX_URBS_POOL   (AR9170_NUM_RX_URBS_MUL * AR9170_NUM_RX_URBS)

Definition at line 196 of file carl9170.h.

#define AR9170_NUM_TX_URBS   8

Definition at line 195 of file carl9170.h.

#define BAW_WITHIN (   _start,
  _bawsz,
  _seqno 
)    ((((_seqno) - (_start)) & 0xfff) < (_bawsz))

Definition at line 109 of file carl9170.h.

#define CARL9170_BAW_BITS   (2 * WME_BA_BMP_SIZE)

Definition at line 122 of file carl9170.h.

#define CARL9170_BAW_LEN   (DIV_ROUND_UP(CARL9170_BAW_BITS, BITS_PER_BYTE))

Definition at line 124 of file carl9170.h.

#define CARL9170_BAW_SIZE   (BITS_TO_LONGS(CARL9170_BAW_BITS))

Definition at line 123 of file carl9170.h.

#define CARL9170_BUMP_QUEUE   1000

Definition at line 151 of file carl9170.h.

#define CARL9170_JANITOR_DELAY   128

Definition at line 153 of file carl9170.h.

#define CARL9170_MAX_RX_BUFFER_SIZE   8192

Definition at line 79 of file carl9170.h.

#define CARL9170_NUM_TID   16

Definition at line 88 of file carl9170.h.

#define CARL9170_NUM_TX_AGG_MAX   30

Definition at line 157 of file carl9170.h.

#define CARL9170_NUM_TX_LIMIT_HARD   ((AR9170_TXQ_DEPTH * 3) / 2)

Definition at line 171 of file carl9170.h.

#define CARL9170_NUM_TX_LIMIT_SOFT   (AR9170_TXQ_DEPTH)

Definition at line 172 of file carl9170.h.

#define CARL9170_QUEUE_STUCK_TIMEOUT   5500

Definition at line 154 of file carl9170.h.

#define CARL9170_QUEUE_TIMEOUT   256

Definition at line 150 of file carl9170.h.

#define CARL9170_STAT_WORK   30000

Definition at line 155 of file carl9170.h.

#define CARL9170_TX_TIMEOUT   2500

Definition at line 152 of file carl9170.h.

#define CARL9170_TX_USER_RATE_TRIES   3

Definition at line 90 of file carl9170.h.

#define CARL9170FW_NAME   "carl9170-1.fw"

Definition at line 67 of file carl9170.h.

#define CHK_DEV_STATE (   a,
  s 
)    (((struct ar9170 *)a)->state >= (s))

Definition at line 506 of file carl9170.h.

#define IS_ACCEPTING_CMD (   a)    (CHK_DEV_STATE(a, CARL9170_IDLE))

Definition at line 508 of file carl9170.h.

#define IS_INITIALIZED (   a)    (CHK_DEV_STATE(a, CARL9170_STOPPED))

Definition at line 507 of file carl9170.h.

#define IS_STARTED (   a)    (CHK_DEV_STATE(a, CARL9170_STARTED))

Definition at line 509 of file carl9170.h.

#define PAYLOAD_MAX   (CARL9170_MAX_CMD_LEN / 4 - 1)

Definition at line 69 of file carl9170.h.

#define SEQ_DIFF (   _start,
  _seq 
)    (((_start) - (_seq)) & 0x0fff)

Definition at line 103 of file carl9170.h.

#define SEQ_NEXT (   _seq)    (((_seq) + 1) & 0x0fff)

Definition at line 107 of file carl9170.h.

#define SEQ_PREV (   _seq)    (((_seq) - 1) & 0x0fff)

Definition at line 105 of file carl9170.h.

#define TID_TO_WME_AC (   _tid)
Value:
((((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \

Definition at line 97 of file carl9170.h.

#define WME_AC_BE   2

Definition at line 92 of file carl9170.h.

#define WME_AC_BK   3

Definition at line 93 of file carl9170.h.

#define WME_AC_VI   1

Definition at line 94 of file carl9170.h.

#define WME_AC_VO   0

Definition at line 95 of file carl9170.h.

#define WME_BA_BMP_SIZE   64

Definition at line 89 of file carl9170.h.

Enumeration Type Documentation

Enumerator:
CARL9170_WPS_BUTTON 
CARL9170_ONE_LED 

Definition at line 198 of file carl9170.h.

Enumerator:
CARL9170_UNKNOWN_STATE 
CARL9170_STOPPED 
CARL9170_IDLE 
CARL9170_STARTED 

Definition at line 81 of file carl9170.h.

Enumerator:
CARL9170_ERP_INVALID 
CARL9170_ERP_AUTO 
CARL9170_ERP_MAC80211 
CARL9170_ERP_OFF 
CARL9170_ERP_CTS 
CARL9170_ERP_RTS 
__CARL9170_ERP_NUM 

Definition at line 232 of file carl9170.h.

Enumerator:
PS_OFF_VIF 
PS_OFF_BCN 

Definition at line 473 of file carl9170.h.

Enumerator:
CARL9170_RR_NO_REASON 
CARL9170_RR_FATAL_FIRMWARE_ERROR 
CARL9170_RR_TOO_MANY_FIRMWARE_ERRORS 
CARL9170_RR_WATCHDOG 
CARL9170_RR_STUCK_TX 
CARL9170_RR_UNRESPONSIVE_DEVICE 
CARL9170_RR_COMMAND_TIMEOUT 
CARL9170_RR_TOO_MANY_PHY_ERRORS 
CARL9170_RR_LOST_RSP 
CARL9170_RR_INVALID_RSP 
CARL9170_RR_USER_REQUEST 
__CARL9170_RR_LAST 

Definition at line 216 of file carl9170.h.

Enumerator:
CARL9170_RFI_NONE 
CARL9170_RFI_WARM 
CARL9170_RFI_COLD 

Definition at line 73 of file carl9170.h.

Enumerator:
CARL9170_TID_STATE_INVALID 
CARL9170_TID_STATE_KILLED 
CARL9170_TID_STATE_SHUTDOWN 
CARL9170_TID_STATE_SUSPEND 
CARL9170_TID_STATE_PROGRESS 
CARL9170_TID_STATE_IDLE 
CARL9170_TID_STATE_XMIT 

Definition at line 112 of file carl9170.h.

Function Documentation

int __carl9170_exec_cmd ( struct ar9170 ar,
struct carl9170_cmd cmd,
const bool  free_buf 
)

Definition at line 595 of file usb.c.

void* carl9170_alloc ( size_t  priv_size)

Definition at line 1711 of file main.c.

int carl9170_disable_key ( struct ar9170 ar,
const u8  id 
)

Definition at line 480 of file mac.c.

int carl9170_exec_cmd ( struct ar9170 ar,
const enum  carl9170_cmd_oids,
u32  plen,
void payload,
u32  rlen,
void resp 
)

Definition at line 636 of file usb.c.

void carl9170_free ( struct ar9170 ar)

Definition at line 2044 of file main.c.

int carl9170_get_noisefloor ( struct ar9170 ar)

Definition at line 1528 of file phy.c.

void carl9170_handle_command_response ( struct ar9170 ar,
void buf,
u32  len 
)

Definition at line 162 of file rx.c.

int carl9170_init_mac ( struct ar9170 ar)

Definition at line 171 of file mac.c.

int carl9170_led_init ( struct ar9170 ar)

Definition at line 48 of file led.c.

int carl9170_led_set_state ( struct ar9170 ar,
const u32  led_state 
)

Definition at line 43 of file led.c.

int carl9170_mod_virtual_mac ( struct ar9170 ar,
const unsigned int  id,
const u8 mac 
)

Definition at line 275 of file mac.c.

void carl9170_op_tx ( struct ieee80211_hw hw,
struct ieee80211_tx_control control,
struct sk_buff skb 
)

Definition at line 1459 of file tx.c.

int carl9170_parse_firmware ( struct ar9170 ar)

Definition at line 398 of file fw.c.

void carl9170_ps_check ( struct ar9170 ar)

Definition at line 758 of file main.c.

int carl9170_register ( struct ar9170 ar)

Definition at line 1928 of file main.c.

void carl9170_restart ( struct ar9170 ar,
const enum carl9170_restart_reasons  r 
)

Definition at line 503 of file main.c.

void carl9170_rx ( struct ar9170 ar,
void buf,
unsigned int  len 
)

Definition at line 989 of file rx.c.

int carl9170_set_ampdu_settings ( struct ar9170 ar)
int carl9170_set_beacon_timers ( struct ar9170 ar)

Definition at line 388 of file mac.c.

int carl9170_set_channel ( struct ar9170 ar,
struct ieee80211_channel channel,
enum nl80211_channel_type  bw,
enum carl9170_rf_init_mode  rfi 
)

Definition at line 1571 of file phy.c.

int carl9170_set_dyn_sifs_ack ( struct ar9170 ar)

Definition at line 44 of file mac.c.

int carl9170_set_hwretry_limit ( struct ar9170 ar,
const u32  max_retry 
)

Definition at line 381 of file mac.c.

int carl9170_set_mac_rates ( struct ar9170 ar)

Definition at line 106 of file mac.c.

int carl9170_set_mac_tpc ( struct ar9170 ar,
struct ieee80211_channel channel 
)

Definition at line 490 of file mac.c.

int carl9170_set_operating_mode ( struct ar9170 ar)

Definition at line 301 of file mac.c.

int carl9170_set_qos ( struct ar9170 ar)

Definition at line 136 of file mac.c.

int carl9170_set_rts_cts_rate ( struct ar9170 ar)

Definition at line 60 of file mac.c.

int carl9170_set_slot_time ( struct ar9170 ar)

Definition at line 84 of file mac.c.

void carl9170_tx_callback ( struct ar9170 ar,
struct sk_buff skb 
)

Definition at line 502 of file tx.c.

void carl9170_tx_drop ( struct ar9170 ar,
struct sk_buff skb 
)

Definition at line 1262 of file tx.c.

void carl9170_tx_get_skb ( struct sk_buff skb)

Definition at line 331 of file tx.c.

void carl9170_tx_janitor ( struct work_struct work)

Definition at line 641 of file tx.c.

void carl9170_tx_process_status ( struct ar9170 ar,
const struct carl9170_rsp cmd 
)

Definition at line 691 of file tx.c.

int carl9170_tx_put_skb ( struct sk_buff skb)

Definition at line 338 of file tx.c.

void carl9170_tx_scheduler ( struct ar9170 ar)

Definition at line 1506 of file tx.c.

void carl9170_tx_status ( struct ar9170 ar,
struct sk_buff skb,
const bool  success 
)

Definition at line 478 of file tx.c.

void carl9170_unregister ( struct ar9170 ar)

Definition at line 2012 of file main.c.

int carl9170_update_beacon ( struct ar9170 ar,
const bool  submit 
)

Definition at line 1516 of file tx.c.

int carl9170_update_multicast ( struct ar9170 ar,
const u64  mc_hast 
)

Definition at line 285 of file mac.c.

int carl9170_upload_key ( struct ar9170 ar,
const u8  id,
const u8 mac,
const u8  ktype,
const u8  keyidx,
const u8 keydata,
const int  keylen 
)

Definition at line 459 of file mac.c.

void carl9170_usb_handle_tx_err ( struct ar9170 ar)

Definition at line 358 of file usb.c.

int carl9170_usb_open ( struct ar9170 ar)

Definition at line 778 of file usb.c.

void carl9170_usb_reset ( struct ar9170 ar)

Definition at line 893 of file usb.c.

int carl9170_usb_restart ( struct ar9170 ar)

Definition at line 851 of file usb.c.

void carl9170_usb_stop ( struct ar9170 ar)

Definition at line 749 of file usb.c.

void carl9170_usb_tx ( struct ar9170 ar,
struct sk_buff skb 
)

Definition at line 697 of file usb.c.

Variable Documentation

struct ieee80211_rate __carl9170_ratetable[]

Definition at line 65 of file main.c.

int modparam_noht

Definition at line 55 of file main.c.