Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
cmd.c File Reference
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/pci.h>
#include <linux/errno.h>
#include <linux/mlx4/cmd.h>
#include <linux/semaphore.h>
#include <rdma/ib_smi.h>
#include <asm/io.h>
#include "mlx4.h"
#include "fw.h"

Go to the source code of this file.

Data Structures

struct  mlx4_cmd_context
 

Macros

#define CMD_POLL_TOKEN   0xffff
 
#define INBOX_MASK   0xffffffffffffff00ULL
 
#define CMD_CHAN_VER   1
 
#define CMD_CHAN_IF_REV   1
 
#define PORT_CAPABILITY_LOCATION_IN_SMP   20
 
#define PORT_STATE_OFFSET   32
 

Enumerations

enum  {
  CMD_STAT_OK = 0x00, CMD_STAT_INTERNAL_ERR = 0x01, CMD_STAT_BAD_OP = 0x02, CMD_STAT_BAD_PARAM = 0x03,
  CMD_STAT_BAD_SYS_STATE = 0x04, CMD_STAT_BAD_RESOURCE = 0x05, CMD_STAT_RESOURCE_BUSY = 0x06, CMD_STAT_EXCEED_LIM = 0x08,
  CMD_STAT_BAD_RES_STATE = 0x09, CMD_STAT_BAD_INDEX = 0x0a, CMD_STAT_BAD_NVMEM = 0x0b, CMD_STAT_ICM_ERROR = 0x0c,
  CMD_STAT_BAD_QP_STATE = 0x10, CMD_STAT_BAD_SEG_PARAM = 0x20, CMD_STAT_REG_BOUND = 0x21, CMD_STAT_LAM_NOT_PRE = 0x22,
  CMD_STAT_BAD_PKT = 0x30, CMD_STAT_BAD_SIZE = 0x40, CMD_STAT_MULTI_FUNC_REQ = 0x50
}
 
enum  {
  HCR_IN_PARAM_OFFSET = 0x00, HCR_IN_MODIFIER_OFFSET = 0x08, HCR_OUT_PARAM_OFFSET = 0x0c, HCR_TOKEN_OFFSET = 0x14,
  HCR_STATUS_OFFSET = 0x18, HCR_OPMOD_SHIFT = 12, HCR_T_BIT = 21, HCR_E_BIT = 22,
  HCR_GO_BIT = 23
}
 
enum  { GO_BIT_TIMEOUT_MSECS = 10000 }
 

Functions

int mlx4_comm_cmd (struct mlx4_dev *dev, u8 cmd, u16 param, unsigned long timeout)
 
void mlx4_cmd_event (struct mlx4_dev *dev, u16 token, u8 status, u64 out_param)
 
int __mlx4_cmd (struct mlx4_dev *dev, u64 in_param, u64 *out_param, int out_is_imm, u32 in_modifier, u8 op_modifier, u16 op, unsigned long timeout, int native)
 
 EXPORT_SYMBOL_GPL (__mlx4_cmd)
 
int mlx4_DMA_wrapper (struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd)
 
void mlx4_master_comm_channel (struct work_struct *work)
 
int mlx4_multi_func_init (struct mlx4_dev *dev)
 
int mlx4_cmd_init (struct mlx4_dev *dev)
 
void mlx4_multi_func_cleanup (struct mlx4_dev *dev)
 
void mlx4_cmd_cleanup (struct mlx4_dev *dev)
 
int mlx4_cmd_use_events (struct mlx4_dev *dev)
 
void mlx4_cmd_use_polling (struct mlx4_dev *dev)
 
struct mlx4_cmd_mailboxmlx4_alloc_cmd_mailbox (struct mlx4_dev *dev)
 
 EXPORT_SYMBOL_GPL (mlx4_alloc_cmd_mailbox)
 
void mlx4_free_cmd_mailbox (struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox)
 
 EXPORT_SYMBOL_GPL (mlx4_free_cmd_mailbox)
 
u32 mlx4_comm_get_version (void)
 

Macro Definition Documentation

#define CMD_CHAN_IF_REV   1

Definition at line 54 of file cmd.c.

#define CMD_CHAN_VER   1

Definition at line 53 of file cmd.c.

#define CMD_POLL_TOKEN   0xffff

Definition at line 50 of file cmd.c.

#define INBOX_MASK   0xffffffffffffff00ULL

Definition at line 51 of file cmd.c.

#define PORT_CAPABILITY_LOCATION_IN_SMP   20

Definition at line 675 of file cmd.c.

#define PORT_STATE_OFFSET   32

Definition at line 676 of file cmd.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CMD_STAT_OK 
CMD_STAT_INTERNAL_ERR 
CMD_STAT_BAD_OP 
CMD_STAT_BAD_PARAM 
CMD_STAT_BAD_SYS_STATE 
CMD_STAT_BAD_RESOURCE 
CMD_STAT_RESOURCE_BUSY 
CMD_STAT_EXCEED_LIM 
CMD_STAT_BAD_RES_STATE 
CMD_STAT_BAD_INDEX 
CMD_STAT_BAD_NVMEM 
CMD_STAT_ICM_ERROR 
CMD_STAT_BAD_QP_STATE 
CMD_STAT_BAD_SEG_PARAM 
CMD_STAT_REG_BOUND 
CMD_STAT_LAM_NOT_PRE 
CMD_STAT_BAD_PKT 
CMD_STAT_BAD_SIZE 
CMD_STAT_MULTI_FUNC_REQ 

Definition at line 56 of file cmd.c.

anonymous enum
Enumerator:
HCR_IN_PARAM_OFFSET 
HCR_IN_MODIFIER_OFFSET 
HCR_OUT_PARAM_OFFSET 
HCR_TOKEN_OFFSET 
HCR_STATUS_OFFSET 
HCR_OPMOD_SHIFT 
HCR_T_BIT 
HCR_E_BIT 
HCR_GO_BIT 

Definition at line 97 of file cmd.c.

anonymous enum
Enumerator:
GO_BIT_TIMEOUT_MSECS 

Definition at line 110 of file cmd.c.

Function Documentation

int __mlx4_cmd ( struct mlx4_dev dev,
u64  in_param,
u64 out_param,
int  out_is_imm,
u32  in_modifier,
u8  op_modifier,
u16  op,
unsigned long  timeout,
int  native 
)

Definition at line 577 of file cmd.c.

EXPORT_SYMBOL_GPL ( __mlx4_cmd  )
EXPORT_SYMBOL_GPL ( mlx4_alloc_cmd_mailbox  )
EXPORT_SYMBOL_GPL ( mlx4_free_cmd_mailbox  )
struct mlx4_cmd_mailbox* mlx4_alloc_cmd_mailbox ( struct mlx4_dev dev)
read

Definition at line 1954 of file cmd.c.

void mlx4_cmd_cleanup ( struct mlx4_dev dev)

Definition at line 1883 of file cmd.c.

void mlx4_cmd_event ( struct mlx4_dev dev,
u16  token,
u8  status,
u64  out_param 
)

Definition at line 512 of file cmd.c.

int mlx4_cmd_init ( struct mlx4_dev dev)

Definition at line 1813 of file cmd.c.

int mlx4_cmd_use_events ( struct mlx4_dev dev)

Definition at line 1901 of file cmd.c.

void mlx4_cmd_use_polling ( struct mlx4_dev dev)

Definition at line 1939 of file cmd.c.

int mlx4_comm_cmd ( struct mlx4_dev dev,
u8  cmd,
u16  param,
unsigned long  timeout 
)

Definition at line 290 of file cmd.c.

u32 mlx4_comm_get_version ( void  )

Definition at line 1984 of file cmd.c.

int mlx4_DMA_wrapper ( struct mlx4_dev dev,
int  slave,
struct mlx4_vhcr vhcr,
struct mlx4_cmd_mailbox inbox,
struct mlx4_cmd_mailbox outbox,
struct mlx4_cmd_info cmd 
)

Definition at line 790 of file cmd.c.

void mlx4_free_cmd_mailbox ( struct mlx4_dev dev,
struct mlx4_cmd_mailbox mailbox 
)

Definition at line 1973 of file cmd.c.

void mlx4_master_comm_channel ( struct work_struct work)

Definition at line 1614 of file cmd.c.

void mlx4_multi_func_cleanup ( struct mlx4_dev dev)

Definition at line 1865 of file cmd.c.

int mlx4_multi_func_init ( struct mlx4_dev dev)

Definition at line 1708 of file cmd.c.