Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
qib_init.c File Reference
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/idr.h>
#include <linux/module.h>
#include <linux/printk.h>
#include "qib.h"
#include "qib_common.h"
#include "qib_mad.h"

Go to the source code of this file.


#define pr_fmt(fmt)   QIB_DRV_NAME ": " fmt
#define DRIVER_LOAD_MSG   "QLogic " QIB_DRV_NAME " loaded: "
#define PFX   QIB_DRV_NAME ": "


 module_param_named (cfgctxts, qib_cfgctxts, ushort, S_IRUGO)
 MODULE_PARM_DESC (cfgctxts,"Set max number of contexts to use")
 module_param_named (mini_init, qib_mini_init, ushort, S_IRUGO)
 MODULE_PARM_DESC (mini_init,"If set, do minimal diag init")
 module_param_named (krcvqs, qib_n_krcv_queues, uint, S_IRUGO)
 MODULE_PARM_DESC (krcvqs,"number of kernel receive queues per IB port")
 module_param_named (cc_table_size, qib_cc_table_size, uint, S_IRUGO)
 MODULE_PARM_DESC (cc_table_size,"Congestion control table entries 0 (CCA disabled - default), min = 128, max = 1984")
 module_param_named (wc_pat, qib_wc_pat, uint, S_IRUGO)
 MODULE_PARM_DESC (wc_pat,"enable write-combining via PAT mechanism")
void qib_set_ctxtcnt (struct qib_devdata *dd)
int qib_create_ctxts (struct qib_devdata *dd)
struct qib_ctxtdataqib_create_ctxtdata (struct qib_pportdata *ppd, u32 ctxt)
void qib_init_pportdata (struct qib_pportdata *ppd, struct qib_devdata *dd, u8 hw_pidx, u8 port)
int qib_init (struct qib_devdata *dd, int reinit)
int __attribute__ ((weak))
struct qib_devdataqib_lookup (int unit)
void qib_free_ctxtdata (struct qib_devdata *dd, struct qib_ctxtdata *rcd)
void qib_free_devdata (struct qib_devdata *dd)
struct qib_devdataqib_alloc_devdata (struct pci_dev *pdev, size_t extra)
void qib_disable_after_error (struct qib_devdata *dd)
 MODULE_DEVICE_TABLE (pci, qib_pci_tbl)
 module_init (qlogic_ib_init)
 module_exit (qlogic_ib_cleanup)
int qib_create_rcvhdrq (struct qib_devdata *dd, struct qib_ctxtdata *rcd)
int qib_setup_eagerbufs (struct qib_ctxtdata *rcd)
int init_chip_wc_pat (struct qib_devdata *dd, u32 vl15buflen)


ushort qib_cfgctxts
ushort qib_mini_init
unsigned qib_n_krcv_queues
unsigned qib_cc_table_size
unsigned qib_wc_pat = 1
struct workqueue_structqib_cq_wq
u32 qib_cpulist_count
unsigned longqib_cpulist
struct pci_driver qib_driver

Macro Definition Documentation

#define DRIVER_LOAD_MSG   "QLogic " QIB_DRV_NAME " loaded: "

Definition at line 1141 of file qib_init.c.

#define PFX   QIB_DRV_NAME ": "

Definition at line 1142 of file qib_init.c.

#define pr_fmt (   fmt)    QIB_DRV_NAME ": " fmt

Definition at line 48 of file qib_init.c.


Definition at line 53 of file qib_init.c.


Definition at line 57 of file qib_init.c.


Definition at line 55 of file qib_init.c.


Definition at line 56 of file qib_init.c.

Function Documentation

int __attribute__ ( (weak)  )

Definition at line 770 of file qib_init.c.

int init_chip_wc_pat ( struct qib_devdata dd,
u32  vl15buflen 

Definition at line 1649 of file qib_init.c.

module_exit ( qlogic_ib_cleanup  )
module_init ( qlogic_ib_init  )
module_param_named ( cfgctxts  ,
qib_cfgctxts  ,
ushort  ,
module_param_named ( mini_init  ,
qib_mini_init  ,
ushort  ,
module_param_named ( krcvqs  ,
qib_n_krcv_queues  ,
uint  ,
module_param_named ( cc_table_size  ,
qib_cc_table_size  ,
uint  ,
module_param_named ( wc_pat  ,
qib_wc_pat  ,
uint  ,
MODULE_PARM_DESC ( cfgctxts  ,
"Set max number of contexts to use"   
MODULE_PARM_DESC ( mini_init  ,
"If  set,
do minimal diag init  
MODULE_PARM_DESC ( krcvqs  ,
"number of kernel receive queues per IB port  
MODULE_PARM_DESC ( cc_table_size  ,
"Congestion control table entries 0   CCA disabled - default,
min  = 128 
MODULE_PARM_DESC ( wc_pat  ,
"enable write-combining via PAT mechanism"   
struct qib_devdata* qib_alloc_devdata ( struct pci_dev pdev,
size_t  extra 

Definition at line 1057 of file qib_init.c.

struct qib_ctxtdata* qib_create_ctxtdata ( struct qib_pportdata ppd,
u32  ctxt 

Definition at line 164 of file qib_init.c.

int qib_create_ctxts ( struct qib_devdata dd)

Definition at line 120 of file qib_init.c.

int qib_create_rcvhdrq ( struct qib_devdata dd,
struct qib_ctxtdata rcd 

qib_create_rcvhdrq - create a receive header queue : the qlogic_ib device : the context data

This must be contiguous memory (from an i/o perspective), and must be DMA'able (which means for some systems, it will go through an IOMMU, or be forced into a low address range).

Definition at line 1490 of file qib_init.c.

void qib_disable_after_error ( struct qib_devdata dd)

Definition at line 1108 of file qib_init.c.

void qib_free_ctxtdata ( struct qib_devdata dd,
struct qib_ctxtdata rcd 

qib_free_ctxtdata - free a context's allocated data : the qlogic_ib device : the ctxtdata structure

free up any allocated data for a context This should not touch anything that would affect a simultaneous re-allocation of context data, because it is called after qib_mutex is released (and can be called from reinit as well). It should never change any chip state, or global driver state.

Definition at line 909 of file qib_init.c.

void qib_free_devdata ( struct qib_devdata dd)

Definition at line 1037 of file qib_init.c.

int qib_init ( struct qib_devdata dd,
int  reinit 

qib_init - do the actual initialization sequence on the chip : the qlogic_ib device : reinitializing, so don't allocate new memory

Do the actual initialization sequence on the chip. This is done both from the init routine called from the PCI infrastructure, and when we reset the chip, or detect that it was reset internally, or it's administratively re-enabled.

Memory allocation here and in called routines is only done in the first case (reinit == 0). We have to be careful, because even without memory allocation, we need to re-write all the chip registers TIDs, etc. after the reset or enable has completed.

Definition at line 621 of file qib_init.c.

void qib_init_pportdata ( struct qib_pportdata ppd,
struct qib_devdata dd,
u8  hw_pidx,
u8  port 

Definition at line 207 of file qib_init.c.

struct qib_devdata* qib_lookup ( int  unit)

Definition at line 784 of file qib_init.c.

void qib_set_ctxtcnt ( struct qib_devdata dd)

Definition at line 101 of file qib_init.c.

int qib_setup_eagerbufs ( struct qib_ctxtdata rcd)

allocate eager buffers, both kernel and user contexts. : the context we are setting up.

Allocate the eager TID buffers and program them into hip. They are no longer completely contiguous, we do multiple allocation calls. Otherwise we get the OOM code involved, by asking for too much per call, with disastrous results on some kernels.

Definition at line 1560 of file qib_init.c.

Variable Documentation

unsigned qib_cc_table_size

Definition at line 79 of file qib_init.c.

ushort qib_cfgctxts

Definition at line 63 of file qib_init.c.

unsigned long* qib_cpulist

Definition at line 98 of file qib_init.c.

u32 qib_cpulist_count

Definition at line 97 of file qib_init.c.

Definition at line 92 of file qib_init.c.

struct pci_driver qib_driver
Initial value:
= {
.name = QIB_DRV_NAME,
.probe = qib_init_one,
.remove = __devexit_p(qib_remove_one),
.id_table = qib_pci_tbl,
.err_handler = &qib_pci_err_handler,

Definition at line 1153 of file qib_init.c.

ushort qib_mini_init

Definition at line 71 of file qib_init.c.

unsigned qib_n_krcv_queues

Definition at line 75 of file qib_init.c.

unsigned qib_wc_pat = 1

Definition at line 88 of file qib_init.c.