Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
zd_usb.h File Reference
#include <linux/completion.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/usb.h>
#include "zd_def.h"

Go to the source code of this file.

Data Structures

struct  usb_req_read_regs
 
struct  reg_data
 
struct  usb_req_write_regs
 
struct  usb_req_rfwrite
 
struct  usb_int_header
 
struct  usb_int_regs
 
struct  usb_int_retry_fail
 
struct  read_regs_int
 
struct  zd_ioreq16
 
struct  zd_ioreq32
 
struct  zd_usb_interrupt
 
struct  zd_usb_rx
 
struct  zd_usb_tx
 
struct  zd_usb
 

Macros

#define ZD_USB_TX_HIGH   5
 
#define ZD_USB_TX_LOW   2
 
#define ZD_TX_TIMEOUT   (HZ * 5)
 
#define ZD_TX_WATCHDOG_INTERVAL   round_jiffies_relative(HZ)
 
#define ZD_RX_IDLE_INTERVAL   round_jiffies_relative(30 * HZ)
 
#define RX_URBS_COUNT   5
 
#define zd_usb_dev(usb)   (&usb->intf->dev)
 

Enumerations

enum  devicetype { DEVICE_ZD1211 = 0, DEVICE_ZD1211B = 1, DEVICE_INSTALLER = 2 }
 
enum  endpoints {
  EP_CTRL = 0, EP_DATA_OUT = 1, EP_DATA_IN = 2, EP_INT_IN = 3,
  EP_REGS_OUT = 4
}
 
enum  {
  USB_MAX_TRANSFER_SIZE = 4096, USB_MAX_RX_SIZE = 4800, USB_MAX_IOWRITE16_COUNT = 15, USB_MAX_IOWRITE32_COUNT = USB_MAX_IOWRITE16_COUNT/2,
  USB_MAX_IOREAD16_COUNT = 15, USB_MAX_IOREAD32_COUNT = USB_MAX_IOREAD16_COUNT/2, USB_MIN_RFWRITE_BIT_COUNT = 16, USB_MAX_RFWRITE_BIT_COUNT = 28,
  USB_MAX_EP_INT_BUFFER = 64, USB_ZD1211B_BCD_DEVICE = 0x4810
}
 
enum  control_requests {
  ReadMem = 0xf1, GetMac = 0xf2, Reset = 0xf4, SetMac = 0xf5,
  SetRxMode = 0xf5, WriteROM = 0xf8, SetReg = 0xfa, GetReg = 0xfb,
  WriteMem = 0xfc, ReadROM = 0xfd, USB_REQ_WRITE_REGS = 0x21, USB_REQ_READ_REGS = 0x22,
  USB_REQ_WRITE_RF = 0x23, USB_REQ_PROG_FLASH = 0x24, USB_REQ_EEPROM_START = 0x0128, USB_REQ_EEPROM_MID = 0x28,
  USB_REQ_EEPROM_END = 0x0228, USB_REQ_FIRMWARE_DOWNLOAD = 0x30, USB_REQ_FIRMWARE_CONFIRM = 0x31, USB_REQ_FIRMWARE_READ_DATA = 0x32
}
 
enum  { RF_IF_LE = 0x02, RF_CLK = 0x04, RF_DATA = 0x08 }
 
enum  usb_int_id { USB_INT_TYPE = 0x01, USB_INT_ID_REGS = 0x90, USB_INT_ID_RETRY_FAILED = 0xa0 }
 
enum  usb_int_flags { USB_INT_READ_REGS_EN = 0x01 }
 

Functions

void zd_usb_init (struct zd_usb *usb, struct ieee80211_hw *hw, struct usb_interface *intf)
 
int zd_usb_init_hw (struct zd_usb *usb)
 
void zd_usb_clear (struct zd_usb *usb)
 
int zd_usb_scnprint_id (struct zd_usb *usb, char *buffer, size_t size)
 
void zd_tx_watchdog_enable (struct zd_usb *usb)
 
void zd_tx_watchdog_disable (struct zd_usb *usb)
 
int zd_usb_enable_int (struct zd_usb *usb)
 
void zd_usb_disable_int (struct zd_usb *usb)
 
int zd_usb_enable_rx (struct zd_usb *usb)
 
void zd_usb_disable_rx (struct zd_usb *usb)
 
void zd_usb_reset_rx_idle_timer (struct zd_usb *usb)
 
void zd_usb_enable_tx (struct zd_usb *usb)
 
void zd_usb_disable_tx (struct zd_usb *usb)
 
int zd_usb_tx (struct zd_usb *usb, struct sk_buff *skb)
 
int zd_usb_ioread16v (struct zd_usb *usb, u16 *values, const zd_addr_t *addresses, unsigned int count)
 
void zd_usb_iowrite16v_async_start (struct zd_usb *usb)
 
int zd_usb_iowrite16v_async_end (struct zd_usb *usb, unsigned int timeout)
 
int zd_usb_iowrite16v_async (struct zd_usb *usb, const struct zd_ioreq16 *ioreqs, unsigned int count)
 
int zd_usb_iowrite16v (struct zd_usb *usb, const struct zd_ioreq16 *ioreqs, unsigned int count)
 
int zd_usb_rfwrite (struct zd_usb *usb, u32 value, u8 bits)
 
int zd_usb_read_fw (struct zd_usb *usb, zd_addr_t addr, u8 *data, u16 len)
 

Variables

struct usb_req_read_regs __packed
 
struct workqueue_structzd_workqueue
 

Macro Definition Documentation

#define RX_URBS_COUNT   5

Definition at line 183 of file zd_usb.h.

#define ZD_RX_IDLE_INTERVAL   round_jiffies_relative(30 * HZ)

Definition at line 37 of file zd_usb.h.

#define ZD_TX_TIMEOUT   (HZ * 5)

Definition at line 35 of file zd_usb.h.

#define ZD_TX_WATCHDOG_INTERVAL   round_jiffies_relative(HZ)

Definition at line 36 of file zd_usb.h.

#define zd_usb_dev (   usb)    (&usb->intf->dev)

Definition at line 231 of file zd_usb.h.

#define ZD_USB_TX_HIGH   5

Definition at line 32 of file zd_usb.h.

#define ZD_USB_TX_LOW   2

Definition at line 33 of file zd_usb.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
USB_MAX_TRANSFER_SIZE 
USB_MAX_RX_SIZE 
USB_MAX_IOWRITE16_COUNT 
USB_MAX_IOWRITE32_COUNT 
USB_MAX_IOREAD16_COUNT 
USB_MAX_IOREAD32_COUNT 
USB_MIN_RFWRITE_BIT_COUNT 
USB_MAX_RFWRITE_BIT_COUNT 
USB_MAX_EP_INT_BUFFER 
USB_ZD1211B_BCD_DEVICE 

Definition at line 53 of file zd_usb.h.

anonymous enum
Enumerator:
RF_IF_LE 
RF_CLK 
RF_DATA 

Definition at line 98 of file zd_usb.h.

Enumerator:
ReadMem 
GetMac 
Reset 
SetMac 
SetRxMode 
WriteROM 
SetReg 
GetReg 
WriteMem 
ReadROM 
USB_REQ_WRITE_REGS 
USB_REQ_READ_REGS 
USB_REQ_WRITE_RF 
USB_REQ_PROG_FLASH 
USB_REQ_EEPROM_START 
USB_REQ_EEPROM_MID 
USB_REQ_EEPROM_END 
USB_REQ_FIRMWARE_DOWNLOAD 
USB_REQ_FIRMWARE_CONFIRM 
USB_REQ_FIRMWARE_READ_DATA 

Definition at line 70 of file zd_usb.h.

enum devicetype
Enumerator:
DEVICE_ZD1211 
DEVICE_ZD1211B 
DEVICE_INSTALLER 

Definition at line 39 of file zd_usb.h.

enum endpoints
Enumerator:
EP_CTRL 
EP_DATA_OUT 
EP_DATA_IN 
EP_INT_IN 
EP_REGS_OUT 

Definition at line 45 of file zd_usb.h.

Enumerator:
USB_INT_READ_REGS_EN 

Definition at line 123 of file zd_usb.h.

enum usb_int_id
Enumerator:
USB_INT_TYPE 
USB_INT_ID_REGS 
USB_INT_ID_RETRY_FAILED 

Definition at line 117 of file zd_usb.h.

Function Documentation

void zd_tx_watchdog_disable ( struct zd_usb usb)

Definition at line 1130 of file zd_usb.c.

void zd_tx_watchdog_enable ( struct zd_usb usb)

Definition at line 1118 of file zd_usb.c.

void zd_usb_clear ( struct zd_usb usb)

Definition at line 1224 of file zd_usb.c.

void zd_usb_disable_int ( struct zd_usb usb)

Definition at line 590 of file zd_usb.c.

void zd_usb_disable_rx ( struct zd_usb usb)

Definition at line 853 of file zd_usb.c.

void zd_usb_disable_tx ( struct zd_usb usb)

zd_usb_disable_tx - disable transmission : the zd1211rw-private USB structure

Frees all URBs in the free list and marks the transmission as disabled.

Definition at line 894 of file zd_usb.c.

int zd_usb_enable_int ( struct zd_usb usb)

Definition at line 527 of file zd_usb.c.

int zd_usb_enable_rx ( struct zd_usb usb)

Definition at line 812 of file zd_usb.c.

void zd_usb_enable_tx ( struct zd_usb usb)

zd_usb_enable_tx - enables transmission : a &struct zd_usb pointer

This function enables transmission and prepares the &zd_usb_tx data structure.

Definition at line 922 of file zd_usb.c.

void zd_usb_init ( struct zd_usb usb,
struct ieee80211_hw hw,
struct usb_interface intf 
)

Definition at line 1212 of file zd_usb.c.

int zd_usb_init_hw ( struct zd_usb usb)

Definition at line 1326 of file zd_usb.c.

int zd_usb_ioread16v ( struct zd_usb usb,
u16 values,
const zd_addr_t addresses,
unsigned int  count 
)

Definition at line 1710 of file zd_usb.c.

int zd_usb_iowrite16v ( struct zd_usb usb,
const struct zd_ioreq16 ioreqs,
unsigned int  count 
)

Definition at line 1963 of file zd_usb.c.

int zd_usb_iowrite16v_async ( struct zd_usb usb,
const struct zd_ioreq16 ioreqs,
unsigned int  count 
)

Definition at line 1879 of file zd_usb.c.

int zd_usb_iowrite16v_async_end ( struct zd_usb usb,
unsigned int  timeout 
)

Definition at line 1843 of file zd_usb.c.

void zd_usb_iowrite16v_async_start ( struct zd_usb usb)

Definition at line 1830 of file zd_usb.c.

int zd_usb_read_fw ( struct zd_usb usb,
zd_addr_t  addr,
u8 data,
u16  len 
)

Definition at line 339 of file zd_usb.c.

void zd_usb_reset_rx_idle_timer ( struct zd_usb usb)

Definition at line 1163 of file zd_usb.c.

int zd_usb_rfwrite ( struct zd_usb usb,
u32  value,
u8  bits 
)

Definition at line 1977 of file zd_usb.c.

int zd_usb_scnprint_id ( struct zd_usb usb,
char buffer,
size_t  size 
)

Definition at line 1255 of file zd_usb.c.

int zd_usb_tx ( struct zd_usb usb,
struct sk_buff skb 
)

zd_usb_tx: initiates transfer of a frame of the device

: the zd1211rw-private USB structure : a &struct sk_buff pointer

This function tranmits a frame to the device. It doesn't wait for completion. The frame must contain the control set and have all the control set information available.

The function returns 0 if the transfer has been successfully initiated.

Definition at line 1030 of file zd_usb.c.

Variable Documentation

struct workqueue_struct* zd_workqueue

Definition at line 1547 of file zd_usb.c.