Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
libertas_tf.h File Reference
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/kthread.h>
#include <net/mac80211.h>
#include "deb_defs.h"

Go to the source code of this file.

Data Structures

struct  lbtf_offset_value
struct  channel_range
struct  lbtf_private
struct  txpd
struct  rxpd
struct  cmd_header
struct  cmd_ctrl_node
struct  cmd_ds_get_hw_spec
struct  cmd_ds_mac_control
struct  cmd_ds_802_11_mac_address
struct  cmd_ds_mac_multicast_addr
struct  cmd_ds_set_mode
struct  cmd_ds_set_bssid
struct  cmd_ds_802_11_radio_control
struct  cmd_ds_802_11_rf_channel
struct  cmd_ds_set_boot2_ver
struct  cmd_ds_802_11_reset
struct  cmd_ds_802_11_beacon_control
struct  cmd_ds_802_11_beacon_set


#define MRVL_PER_PACKET_RATE   0x10
#define MRVL_MAX_BCN_SIZE   440
#define CMD_OPTION_WAITFORRSP   0x0002
#define CMD_RET(cmd)   (0x8000 | cmd)
#define CMD_GET_HW_SPEC   0x0003
#define CMD_802_11_RESET   0x0005
#define CMD_MAC_MULTICAST_ADR   0x0010
#define CMD_802_11_RADIO_CONTROL   0x001c
#define CMD_802_11_RF_CHANNEL   0x001d
#define CMD_802_11_RF_TX_POWER   0x001e
#define CMD_MAC_CONTROL   0x0028
#define CMD_802_11_MAC_ADDRESS   0x004d
#define CMD_SET_BOOT2_VER   0x00a5
#define CMD_802_11_BEACON_CTRL   0x00b0
#define CMD_802_11_BEACON_SET   0x00cb
#define CMD_802_11_SET_MODE   0x00cc
#define CMD_802_11_SET_BSSID   0x00cd
#define CMD_ACT_GET   0x0000
#define CMD_ACT_SET   0x0001
#define CMD_ACT_HALT   0x0003
#define CMD_ACT_MAC_RX_ON   0x0001
#define CMD_ACT_MAC_TX_ON   0x0002
#define CMD_TYPE_AUTO_PREAMBLE   0x0001
#define CMD_TYPE_SHORT_PREAMBLE   0x0002
#define CMD_TYPE_LONG_PREAMBLE   0x0003
#define TURN_ON_RF   0x01
#define RADIO_ON   0x01
#define RADIO_OFF   0x00
#define SET_AUTO_PREAMBLE   0x05
#define SET_SHORT_PREAMBLE   0x03
#define SET_LONG_PREAMBLE   0x01
#define CMD_OPT_802_11_RF_CHANNEL_GET   0x00
#define CMD_OPT_802_11_RF_CHANNEL_SET   0x01
#define LBS_NUM_CMD_BUFFERS   10
#define LBS_CMD_BUFFER_SIZE   (2 * 1024)
#define LBS_UPLD_SIZE   2312
#define DEV_NAME_LEN   32
#define LBTF_REGDOMAIN_US   0x10
#define LBTF_REGDOMAIN_CA   0x20
#define LBTF_REGDOMAIN_EU   0x30
#define LBTF_REGDOMAIN_SP   0x31
#define LBTF_REGDOMAIN_FR   0x32
#define LBTF_REGDOMAIN_JP   0x40
#define MRVDRV_RXPD_STATUS_OK   0x0001
#define EXTRA_LEN   36
#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE   (ETH_FRAME_LEN + sizeof(struct txpd) + EXTRA_LEN)
#define CMD_F_HOSTCMD   (1 << 0)
#define FW_CAPINFO_WPA   (1 << 0)
#define RF_ANTENNA_1   0x1
#define RF_ANTENNA_2   0x2
#define LBTF_EVENT_BCN_SENT   55
#define lbtf_cmd(priv, cmdnr, cmd, cb, cb_arg)
#define lbtf_cmd_with_response(priv, cmdnr, cmd)   lbtf_cmd(priv, cmdnr, cmd, lbtf_cmd_copyback, (unsigned long) (cmd))


enum  mv_ms_type {


void lbtf_set_mac_control (struct lbtf_private *priv)
int lbtf_free_cmd_buffer (struct lbtf_private *priv)
int lbtf_allocate_cmd_buffer (struct lbtf_private *priv)
int lbtf_execute_next_command (struct lbtf_private *priv)
int lbtf_set_radio_control (struct lbtf_private *priv)
int lbtf_update_hw_spec (struct lbtf_private *priv)
int lbtf_cmd_set_mac_multicast_addr (struct lbtf_private *priv)
void lbtf_set_mode (struct lbtf_private *priv, enum lbtf_mode mode)
void lbtf_set_bssid (struct lbtf_private *priv, bool activate, const u8 *bssid)
int lbtf_set_mac_address (struct lbtf_private *priv, uint8_t *mac_addr)
int lbtf_set_channel (struct lbtf_private *priv, u8 channel)
int lbtf_beacon_set (struct lbtf_private *priv, struct sk_buff *beacon)
int lbtf_beacon_ctrl (struct lbtf_private *priv, bool beacon_enable, int beacon_int)
int lbtf_process_rx_command (struct lbtf_private *priv)
void lbtf_complete_command (struct lbtf_private *priv, struct cmd_ctrl_node *cmd, int result)
void lbtf_cmd_response_rx (struct lbtf_private *priv)
struct chan_freq_power * lbtf_get_region_cfp_table (u8 region, int *cfp_no)
struct lbtf_privatelbtf_add_card (void *card, struct device *dmdev)
int lbtf_remove_card (struct lbtf_private *priv)
int lbtf_start_card (struct lbtf_private *priv)
int lbtf_rx (struct lbtf_private *priv, struct sk_buff *skb)
void lbtf_send_tx_feedback (struct lbtf_private *priv, u8 retrycnt, u8 fail)
void lbtf_bcn_sent (struct lbtf_private *priv)
void lbtf_cmd_async (struct lbtf_private *priv, uint16_t command, struct cmd_header *in_cmd, int in_cmd_size)
int __lbtf_cmd (struct lbtf_private *priv, uint16_t command, struct cmd_header *in_cmd, int in_cmd_size, int(*callback)(struct lbtf_private *, unsigned long, struct cmd_header *), unsigned long callback_arg)
int lbtf_cmd_copyback (struct lbtf_private *priv, unsigned long extra, struct cmd_header *resp)


struct workqueue_structlbtf_wq
struct cmd_header __packed

Macro Definition Documentation

#define CMD_802_11_BEACON_CTRL   0x00b0

Definition at line 42 of file libertas_tf.h.

#define CMD_802_11_BEACON_SET   0x00cb

Definition at line 43 of file libertas_tf.h.

#define CMD_802_11_MAC_ADDRESS   0x004d

Definition at line 40 of file libertas_tf.h.

#define CMD_802_11_RADIO_CONTROL   0x001c

Definition at line 36 of file libertas_tf.h.

#define CMD_802_11_RESET   0x0005

Definition at line 34 of file libertas_tf.h.

#define CMD_802_11_RF_CHANNEL   0x001d

Definition at line 37 of file libertas_tf.h.

#define CMD_802_11_RF_TX_POWER   0x001e

Definition at line 38 of file libertas_tf.h.

#define CMD_802_11_SET_BSSID   0x00cd

Definition at line 45 of file libertas_tf.h.

#define CMD_802_11_SET_MODE   0x00cc

Definition at line 44 of file libertas_tf.h.

#define CMD_ACT_GET   0x0000

Definition at line 47 of file libertas_tf.h.

#define CMD_ACT_HALT   0x0003

Definition at line 51 of file libertas_tf.h.


Definition at line 59 of file libertas_tf.h.


Definition at line 57 of file libertas_tf.h.


Definition at line 56 of file libertas_tf.h.


Definition at line 58 of file libertas_tf.h.

#define CMD_ACT_MAC_RX_ON   0x0001

Definition at line 54 of file libertas_tf.h.

#define CMD_ACT_MAC_TX_ON   0x0002

Definition at line 55 of file libertas_tf.h.

#define CMD_ACT_SET   0x0001

Definition at line 48 of file libertas_tf.h.

#define CMD_F_HOSTCMD   (1 << 0)

Definition at line 141 of file libertas_tf.h.

#define CMD_GET_HW_SPEC   0x0003

Definition at line 33 of file libertas_tf.h.

#define CMD_MAC_CONTROL   0x0028

Definition at line 39 of file libertas_tf.h.

#define CMD_MAC_MULTICAST_ADR   0x0010

Definition at line 35 of file libertas_tf.h.

#define CMD_OPT_802_11_RF_CHANNEL_GET   0x00

Definition at line 75 of file libertas_tf.h.

#define CMD_OPT_802_11_RF_CHANNEL_SET   0x01

Definition at line 76 of file libertas_tf.h.

#define CMD_OPTION_WAITFORRSP   0x0002

Definition at line 25 of file libertas_tf.h.

#define CMD_RET (   cmd)    (0x8000 | cmd)

Definition at line 30 of file libertas_tf.h.

#define CMD_SET_BOOT2_VER   0x00a5

Definition at line 41 of file libertas_tf.h.

#define CMD_TYPE_AUTO_PREAMBLE   0x0001

Definition at line 62 of file libertas_tf.h.

#define CMD_TYPE_LONG_PREAMBLE   0x0003

Definition at line 64 of file libertas_tf.h.

#define CMD_TYPE_SHORT_PREAMBLE   0x0002

Definition at line 63 of file libertas_tf.h.

#define DEV_NAME_LEN   32

Definition at line 108 of file libertas_tf.h.

#define EXTRA_LEN   36

Definition at line 132 of file libertas_tf.h.

#define FW_CAPINFO_WPA   (1 << 0)

Definition at line 142 of file libertas_tf.h.

#define LBS_CMD_BUFFER_SIZE   (2 * 1024)

Definition at line 103 of file libertas_tf.h.

#define LBS_NUM_CMD_BUFFERS   10

Definition at line 102 of file libertas_tf.h.

#define LBS_UPLD_SIZE   2312

Definition at line 107 of file libertas_tf.h.

#define lbtf_cmd (   priv,
({ \
uint16_t __sz = le16_to_cpu((cmd)->hdr.size); \
(cmd)->hdr.size = cpu_to_le16(sizeof(*(cmd))); \
__lbtf_cmd(priv, cmdnr, &(cmd)->hdr, __sz, cb, cb_arg); \

Definition at line 500 of file libertas_tf.h.

#define lbtf_cmd_with_response (   priv,
)    lbtf_cmd(priv, cmdnr, cmd, lbtf_cmd_copyback, (unsigned long) (cmd))

Definition at line 506 of file libertas_tf.h.

#define LBTF_EVENT_BCN_SENT   55

Definition at line 148 of file libertas_tf.h.

#define LBTF_REGDOMAIN_CA   0x20

Definition at line 118 of file libertas_tf.h.

#define LBTF_REGDOMAIN_EU   0x30

Definition at line 119 of file libertas_tf.h.

#define LBTF_REGDOMAIN_FR   0x32

Definition at line 121 of file libertas_tf.h.

#define LBTF_REGDOMAIN_JP   0x40

Definition at line 122 of file libertas_tf.h.

#define LBTF_REGDOMAIN_SP   0x31

Definition at line 120 of file libertas_tf.h.

#define LBTF_REGDOMAIN_US   0x10

the table to keep region code

Definition at line 117 of file libertas_tf.h.


Card Event definition

Definition at line 86 of file libertas_tf.h.


Definition at line 137 of file libertas_tf.h.

#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE   (ETH_FRAME_LEN + sizeof(struct txpd) + EXTRA_LEN)

Definition at line 134 of file libertas_tf.h.


Definition at line 104 of file libertas_tf.h.


Buffer Constants

Definition at line 101 of file libertas_tf.h.


Misc constants

Definition at line 113 of file libertas_tf.h.

#define MRVDRV_RXPD_STATUS_OK   0x0001

RxPD status

Definition at line 128 of file libertas_tf.h.


Definition at line 105 of file libertas_tf.h.


Definition at line 22 of file libertas_tf.h.

#define MRVL_MAX_BCN_SIZE   440

Definition at line 24 of file libertas_tf.h.

#define MRVL_PER_PACKET_RATE   0x10

Definition at line 23 of file libertas_tf.h.

#define RADIO_OFF   0x00

Definition at line 68 of file libertas_tf.h.

#define RADIO_ON   0x01

Definition at line 67 of file libertas_tf.h.

#define RF_ANTENNA_1   0x1

Definition at line 144 of file libertas_tf.h.

#define RF_ANTENNA_2   0x2

Definition at line 145 of file libertas_tf.h.


Definition at line 146 of file libertas_tf.h.


Definition at line 124 of file libertas_tf.h.

#define SET_AUTO_PREAMBLE   0x05

Definition at line 70 of file libertas_tf.h.

#define SET_LONG_PREAMBLE   0x01

Definition at line 72 of file libertas_tf.h.

#define SET_SHORT_PREAMBLE   0x03

Definition at line 71 of file libertas_tf.h.

#define TURN_ON_RF   0x01

Definition at line 66 of file libertas_tf.h.

Enumeration Type Documentation

enum lbtf_mode

Definition at line 79 of file libertas_tf.h.

enum mv_ms_type

Global Variable Declaration mv_ms_type


Definition at line 152 of file libertas_tf.h.

Function Documentation

int __lbtf_cmd ( struct lbtf_private priv,
uint16_t  command,
struct cmd_header in_cmd,
int  in_cmd_size,
int(*)(struct lbtf_private *, unsigned long, struct cmd_header *)  callback,
unsigned long  callback_arg 

Definition at line 665 of file cmd.c.

struct lbtf_private* lbtf_add_card ( void card,
struct device dmdev 

lbtf_add_card: Add and initialize the card, no fw upload yet.

A pointer to card

Returns: pointer to struct lbtf_priv.

Definition at line 620 of file main.c.

int lbtf_allocate_cmd_buffer ( struct lbtf_private priv)

lbtf_allocate_cmd_buffer - Allocates cmd buffer, links it to free cmd queue

A pointer to struct lbtf_private structure

Returns: 0 on success.

Definition at line 445 of file cmd.c.

void lbtf_bcn_sent ( struct lbtf_private priv)

Definition at line 716 of file main.c.

int lbtf_beacon_ctrl ( struct lbtf_private priv,
bool  beacon_enable,
int  beacon_int 

Definition at line 191 of file cmd.c.

int lbtf_beacon_set ( struct lbtf_private priv,
struct sk_buff beacon 

Definition at line 169 of file cmd.c.

void lbtf_cmd_async ( struct lbtf_private priv,
uint16_t  command,
struct cmd_header in_cmd,
int  in_cmd_size 

Definition at line 657 of file cmd.c.

int lbtf_cmd_copyback ( struct lbtf_private priv,
unsigned long  extra,
struct cmd_header resp 

lbtf_cmd_copyback - Simple callback that copies response back into command

A pointer to struct lbtf_private structure A pointer to the original command structure for which 'resp' is a response A pointer to the command response

Returns: 0 on success, error on failure

Definition at line 46 of file cmd.c.

void lbtf_cmd_response_rx ( struct lbtf_private priv)

Definition at line 709 of file cmd.c.

int lbtf_cmd_set_mac_multicast_addr ( struct lbtf_private priv)

Definition at line 320 of file cmd.c.

void lbtf_complete_command ( struct lbtf_private priv,
struct cmd_ctrl_node cmd,
int  result 

Definition at line 308 of file cmd.c.

int lbtf_execute_next_command ( struct lbtf_private priv)

lbtf_execute_next_command: execute next command in cmd pending queue.

A pointer to struct lbtf_private structure

Returns: 0 on success.

Definition at line 564 of file cmd.c.

int lbtf_free_cmd_buffer ( struct lbtf_private priv)

lbtf_free_cmd_buffer - Frees the cmd buffer.

A pointer to struct lbtf_private structure

Returns: 0

Definition at line 493 of file cmd.c.

struct chan_freq_power* lbtf_get_region_cfp_table ( u8  region,
int cfp_no 
int lbtf_process_rx_command ( struct lbtf_private priv)

Definition at line 716 of file cmd.c.

int lbtf_remove_card ( struct lbtf_private priv)

Definition at line 675 of file main.c.

int lbtf_rx ( struct lbtf_private priv,
struct sk_buff skb 

Definition at line 560 of file main.c.

void lbtf_send_tx_feedback ( struct lbtf_private priv,
u8  retrycnt,
u8  fail 

Definition at line 693 of file main.c.

void lbtf_set_bssid ( struct lbtf_private priv,
bool  activate,
const u8 bssid 

Definition at line 355 of file cmd.c.

int lbtf_set_channel ( struct lbtf_private priv,
u8  channel 

lbtf_set_channel: Set the radio channel

A pointer to struct lbtf_private structure The desired channel, or 0 to clear a locked channel

Returns: 0 on success, error on failure

Definition at line 153 of file cmd.c.

int lbtf_set_mac_address ( struct lbtf_private priv,
uint8_t mac_addr 

Definition at line 369 of file cmd.c.

void lbtf_set_mac_control ( struct lbtf_private priv)

Function Prototype Declaration

Definition at line 423 of file cmd.c.

void lbtf_set_mode ( struct lbtf_private priv,
enum lbtf_mode  mode 

Definition at line 342 of file cmd.c.

int lbtf_set_radio_control ( struct lbtf_private priv)

Definition at line 384 of file cmd.c.

int lbtf_start_card ( struct lbtf_private priv)
int lbtf_update_hw_spec ( struct lbtf_private priv)

lbtf_update_hw_spec: Updates the hardware details.

A pointer to struct lbtf_private structure

Returns: 0 on success, error on failure

Definition at line 83 of file cmd.c.

Variable Documentation

Definition at line 36 of file main.c.