Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
iwl-trans.h File Reference
#include <linux/ieee80211.h>
#include <linux/mm.h>
#include "iwl-debug.h"
#include "iwl-config.h"
#include "iwl-fw.h"

Go to the source code of this file.

Data Structures

struct  iwl_cmd_header
 
struct  iwl_rx_packet
 
struct  iwl_device_cmd
 
struct  iwl_host_cmd
 
struct  iwl_rx_cmd_buffer
 
struct  iwl_trans_config
 
struct  iwl_trans_ops
 
struct  iwl_trans
 

Macros

#define SEQ_TO_SN(seq)   (((seq) & IEEE80211_SCTL_SEQ) >> 4)
 
#define SN_TO_SEQ(ssn)   (((ssn) << 4) & IEEE80211_SCTL_SEQ)
 
#define MAX_SN   ((IEEE80211_SCTL_SEQ) >> 4)
 
#define SEQ_TO_QUEUE(s)   (((s) >> 8) & 0x1f)
 
#define QUEUE_TO_SEQ(q)   (((q) & 0x1f) << 8)
 
#define SEQ_TO_INDEX(s)   ((s) & 0xff)
 
#define INDEX_TO_SEQ(i)   ((i) & 0xff)
 
#define SEQ_RX_FRAME   cpu_to_le16(0x8000)
 
#define IWL_CMD_FAILED_MSK   0x40
 
#define FH_RSCSR_FRAME_SIZE_MSK   0x00003FFF /* bits 0-13 */
 
#define FH_RSCSR_FRAME_INVALID   0x55550000
 
#define FH_RSCSR_FRAME_ALIGN   0x40
 
#define DEF_CMD_PAYLOAD_SIZE   320
 
#define TFD_MAX_PAYLOAD_SIZE   (sizeof(struct iwl_device_cmd))
 
#define IWL_MAX_CMD_TFDS   2
 
#define MAX_NO_RECLAIM_CMDS   6
 
#define IWL_MASK(lo, hi)   ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
 
#define IWL_MAX_HW_QUEUES   32
 
#define IWL_INVALID_STATION   255
 
#define IWL_MAX_TID_COUNT   8
 
#define IWL_FRAME_LIMIT   64
 

Enumerations

enum  CMD_MODE {
  CMD_SYNC = 0, CMD_ASYNC = BIT(0), CMD_WANT_SKB = BIT(1), CMD_WANT_HCMD = BIT(2),
  CMD_ON_DEMAND = BIT(3)
}
 
enum  iwl_hcmd_dataflag { IWL_HCMD_DFL_NOCOPY = BIT(0) }
 
enum  iwl_trans_state { IWL_TRANS_NO_FW = 0, IWL_TRANS_FW_ALIVE = 1 }
 

Functions

int __must_check iwl_pci_register_driver (void)
 
void iwl_pci_unregister_driver (void)
 

Variables

struct iwl_cmd_header __packed
 

Macro Definition Documentation

#define DEF_CMD_PAYLOAD_SIZE   320

Definition at line 203 of file iwl-trans.h.

#define FH_RSCSR_FRAME_ALIGN   0x40

Definition at line 163 of file iwl-trans.h.

#define FH_RSCSR_FRAME_INVALID   0x55550000

Definition at line 162 of file iwl-trans.h.

#define FH_RSCSR_FRAME_SIZE_MSK   0x00003FFF /* bits 0-13 */

Definition at line 161 of file iwl-trans.h.

#define INDEX_TO_SEQ (   i)    ((i) & 0xff)

Definition at line 122 of file iwl-trans.h.

#define IWL_CMD_FAILED_MSK   0x40

Definition at line 158 of file iwl-trans.h.

#define IWL_FRAME_LIMIT   64

Definition at line 301 of file iwl-trans.h.

#define IWL_INVALID_STATION   255

Definition at line 299 of file iwl-trans.h.

#define IWL_MASK (   lo,
  hi 
)    ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))

Definition at line 292 of file iwl-trans.h.

#define IWL_MAX_CMD_TFDS   2

Definition at line 219 of file iwl-trans.h.

#define IWL_MAX_HW_QUEUES   32

Definition at line 298 of file iwl-trans.h.

#define IWL_MAX_TID_COUNT   8

Definition at line 300 of file iwl-trans.h.

#define MAX_NO_RECLAIM_CMDS   6

Definition at line 290 of file iwl-trans.h.

#define MAX_SN   ((IEEE80211_SCTL_SEQ) >> 4)

Definition at line 118 of file iwl-trans.h.

#define QUEUE_TO_SEQ (   q)    (((q) & 0x1f) << 8)

Definition at line 120 of file iwl-trans.h.

#define SEQ_RX_FRAME   cpu_to_le16(0x8000)

Definition at line 123 of file iwl-trans.h.

#define SEQ_TO_INDEX (   s)    ((s) & 0xff)

Definition at line 121 of file iwl-trans.h.

#define SEQ_TO_QUEUE (   s)    (((s) >> 8) & 0x1f)

Definition at line 119 of file iwl-trans.h.

#define SEQ_TO_SN (   seq)    (((seq) & IEEE80211_SCTL_SEQ) >> 4)

DOC: Transport layer - what is it ?

The tranport layer is the layer that deals with the HW directly. It provides an abstraction of the underlying HW to the upper layer. The transport layer doesn't provide any policy, algorithm or anything of this kind, but only mechanisms to make the HW do something.It is not completely stateless but close to it. We will have an implementation for each different supported bus. DOC: Life cycle of the transport layer

The transport layer has a very precise life cycle.

1) A helper function is called during the module initialization and registers the bus driver's ops with the transport's alloc function. 2) Bus's probe calls to the transport layer's allocation functions. Of course this function is bus specific. 3) This allocation functions will spawn the upper layer which will register mac80211.

4) At some point (i.e. mac80211's start call), the op_mode will call the following sequence: start_hw start_fw

5) Then when finished (or reset): stop_fw (a.k.a. stop device for the moment) stop_hw

6) Eventually, the free function will be called. DOC: Host command section

A host command is a commaned issued by the upper layer to the fw. There are several versions of fw that have several APIs. The transport layer is completely agnostic to these differences. The transport does provide helper functionnality (i.e. SYNC / ASYNC mode),

Definition at line 116 of file iwl-trans.h.

#define SN_TO_SEQ (   ssn)    (((ssn) << 4) & IEEE80211_SCTL_SEQ)

Definition at line 117 of file iwl-trans.h.

#define TFD_MAX_PAYLOAD_SIZE   (sizeof(struct iwl_device_cmd))

Definition at line 217 of file iwl-trans.h.

Enumeration Type Documentation

enum CMD_MODE

enum CMD_MODE - how to send the host commands ?

: The caller will be stalled until the fw responds to the command : Return right away and don't want for the response : valid only with CMD_SYNC. The caller needs the buffer of the response. The caller needs to call iwl_free_resp when done. : The caller needs to get the HCMD that was sent in the response handler. Chunks flagged by IWL_HCMD_DFL_NOCOPY won't be copied. The pointer passed to the response handler is in the transport ownership and don't need to be freed by the op_mode. This also means that the pointer is invalidated after the op_mode's handler returns. : This command is sent by the test mode pipe.

Enumerator:
CMD_SYNC 
CMD_ASYNC 
CMD_WANT_SKB 
CMD_WANT_HCMD 
CMD_ON_DEMAND 

Definition at line 195 of file iwl-trans.h.

struct iwl_hcmd_dataflag - flag for each one of the chunks of the command

IWL_HCMD_DFL_NOCOPY: By default, the command is copied to the host command's ring. The transport layer doesn't map the command's buffer to DMA, but rather copies it to an previously allocated DMA buffer. This flag tells the transport layer not to copy the command, but to map the existing buffer. This can save memcpy and is worth with very big comamnds.

Enumerator:
IWL_HCMD_DFL_NOCOPY 

Definition at line 230 of file iwl-trans.h.

enum iwl_trans_state - state of the transport layer

: no fw has sent an alive response : a fw has sent an alive response

Enumerator:
IWL_TRANS_NO_FW 
IWL_TRANS_FW_ALIVE 

Definition at line 424 of file iwl-trans.h.

Function Documentation

int __must_check iwl_pci_register_driver ( void  )

Definition at line 360 of file drv.c.

void iwl_pci_unregister_driver ( void  )

Definition at line 370 of file drv.c.

Variable Documentation