Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mthca_memfree.h File Reference
#include <linux/list.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  mthca_icm_chunk
 
struct  mthca_icm
 
struct  mthca_icm_table
 
struct  mthca_icm_iter
 
struct  mthca_db_page
 
struct  mthca_db_table
 

Macros

#define MTHCA_ICM_CHUNK_LEN
 

Enumerations

enum  { MTHCA_ICM_PAGE_SHIFT = 12, MTHCA_ICM_PAGE_SIZE = 1 << MTHCA_ICM_PAGE_SHIFT, MTHCA_DB_REC_PER_PAGE = MTHCA_ICM_PAGE_SIZE / 8 }
 
enum  mthca_db_type {
  MTHCA_DB_TYPE_INVALID = 0x0, MTHCA_DB_TYPE_CQ_SET_CI = 0x1, MTHCA_DB_TYPE_CQ_ARM = 0x2, MTHCA_DB_TYPE_SQ = 0x3,
  MTHCA_DB_TYPE_RQ = 0x4, MTHCA_DB_TYPE_SRQ = 0x5, MTHCA_DB_TYPE_GROUP_SEP = 0x7
}
 

Functions

struct mthca_icmmthca_alloc_icm (struct mthca_dev *dev, int npages, gfp_t gfp_mask, int coherent)
 
void mthca_free_icm (struct mthca_dev *dev, struct mthca_icm *icm, int coherent)
 
struct mthca_icm_tablemthca_alloc_icm_table (struct mthca_dev *dev, u64 virt, int obj_size, int nobj, int reserved, int use_lowmem, int use_coherent)
 
void mthca_free_icm_table (struct mthca_dev *dev, struct mthca_icm_table *table)
 
int mthca_table_get (struct mthca_dev *dev, struct mthca_icm_table *table, int obj)
 
void mthca_table_put (struct mthca_dev *dev, struct mthca_icm_table *table, int obj)
 
voidmthca_table_find (struct mthca_icm_table *table, int obj, dma_addr_t *dma_handle)
 
int mthca_table_get_range (struct mthca_dev *dev, struct mthca_icm_table *table, int start, int end)
 
void mthca_table_put_range (struct mthca_dev *dev, struct mthca_icm_table *table, int start, int end)
 
int mthca_map_user_db (struct mthca_dev *dev, struct mthca_uar *uar, struct mthca_user_db_table *db_tab, int index, u64 uaddr)
 
void mthca_unmap_user_db (struct mthca_dev *dev, struct mthca_uar *uar, struct mthca_user_db_table *db_tab, int index)
 
struct mthca_user_db_tablemthca_init_user_db_tab (struct mthca_dev *dev)
 
void mthca_cleanup_user_db_tab (struct mthca_dev *dev, struct mthca_uar *uar, struct mthca_user_db_table *db_tab)
 
int mthca_init_db_tab (struct mthca_dev *dev)
 
void mthca_cleanup_db_tab (struct mthca_dev *dev)
 
int mthca_alloc_db (struct mthca_dev *dev, enum mthca_db_type type, u32 qn, __be32 **db)
 
void mthca_free_db (struct mthca_dev *dev, int type, int db_index)
 

Macro Definition Documentation

#define MTHCA_ICM_CHUNK_LEN
Value:
((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \
(sizeof (struct scatterlist)))

Definition at line 41 of file mthca_memfree.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
MTHCA_ICM_PAGE_SHIFT 
MTHCA_ICM_PAGE_SIZE 
MTHCA_DB_REC_PER_PAGE 

Definition at line 45 of file mthca_memfree.h.

Enumerator:
MTHCA_DB_TYPE_INVALID 
MTHCA_DB_TYPE_CQ_SET_CI 
MTHCA_DB_TYPE_CQ_ARM 
MTHCA_DB_TYPE_SQ 
MTHCA_DB_TYPE_RQ 
MTHCA_DB_TYPE_SRQ 
MTHCA_DB_TYPE_GROUP_SEP 

Definition at line 152 of file mthca_memfree.h.

Function Documentation

int mthca_alloc_db ( struct mthca_dev dev,
enum mthca_db_type  type,
u32  qn,
__be32 **  db 
)

Definition at line 566 of file mthca_memfree.c.

struct mthca_icm* mthca_alloc_icm ( struct mthca_dev dev,
int  npages,
gfp_t  gfp_mask,
int  coherent 
)
read

Definition at line 137 of file mthca_memfree.c.

struct mthca_icm_table* mthca_alloc_icm_table ( struct mthca_dev dev,
u64  virt,
int  obj_size,
int  nobj,
int  reserved,
int  use_lowmem,
int  use_coherent 
)
read

Definition at line 356 of file mthca_memfree.c.

void mthca_cleanup_db_tab ( struct mthca_dev dev)

Definition at line 731 of file mthca_memfree.c.

void mthca_cleanup_user_db_tab ( struct mthca_dev dev,
struct mthca_uar uar,
struct mthca_user_db_table db_tab 
)

Definition at line 547 of file mthca_memfree.c.

void mthca_free_db ( struct mthca_dev dev,
int  type,
int  db_index 
)

Definition at line 664 of file mthca_memfree.c.

void mthca_free_icm ( struct mthca_dev dev,
struct mthca_icm icm,
int  coherent 
)

Definition at line 88 of file mthca_memfree.c.

void mthca_free_icm_table ( struct mthca_dev dev,
struct mthca_icm_table table 
)

Definition at line 424 of file mthca_memfree.c.

int mthca_init_db_tab ( struct mthca_dev dev)

Definition at line 700 of file mthca_memfree.c.

struct mthca_user_db_table* mthca_init_user_db_tab ( struct mthca_dev dev)
read

Definition at line 523 of file mthca_memfree.c.

int mthca_map_user_db ( struct mthca_dev dev,
struct mthca_uar uar,
struct mthca_user_db_table db_tab,
int  index,
u64  uaddr 
)

Definition at line 446 of file mthca_memfree.c.

void* mthca_table_find ( struct mthca_icm_table table,
int  obj,
dma_addr_t dma_handle 
)

Definition at line 278 of file mthca_memfree.c.

int mthca_table_get ( struct mthca_dev dev,
struct mthca_icm_table table,
int  obj 
)

Definition at line 222 of file mthca_memfree.c.

int mthca_table_get_range ( struct mthca_dev dev,
struct mthca_icm_table table,
int  start,
int  end 
)

Definition at line 321 of file mthca_memfree.c.

void mthca_table_put ( struct mthca_dev dev,
struct mthca_icm_table table,
int  obj 
)

Definition at line 257 of file mthca_memfree.c.

void mthca_table_put_range ( struct mthca_dev dev,
struct mthca_icm_table table,
int  start,
int  end 
)

Definition at line 344 of file mthca_memfree.c.

void mthca_unmap_user_db ( struct mthca_dev dev,
struct mthca_uar uar,
struct mthca_user_db_table db_tab,
int  index 
)

Definition at line 505 of file mthca_memfree.c.