Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
qib_driver.c File Reference
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/vmalloc.h>
#include <linux/module.h>
#include <linux/prefetch.h>
#include "qib.h"

Go to the source code of this file.

Macros

#define QIB_PIO_MAXIBHDR   128
 
#define QIB_MAX_PKT_RECV   64
 
#define LED_OVER_FREQ_SHIFT   8
 
#define LED_OVER_FREQ_MASK   (0xFF<<LED_OVER_FREQ_SHIFT)
 
#define LED_OVER_BOTH_OFF   (8)
 

Functions

 DEFINE_SPINLOCK (qib_devs_lock)
 
 LIST_HEAD (qib_dev_list)
 
 DEFINE_MUTEX (qib_mutex)
 
 module_param_named (ibmtu, qib_ibmtu, uint, S_IRUGO)
 
 MODULE_PARM_DESC (ibmtu,"Set max IB MTU (0=2KB, 1=256, 2=512, ... 5=4096")
 
 module_param_named (compat_ddr_negotiate, qib_compat_ddr_negotiate, uint, S_IWUSR|S_IRUGO)
 
 MODULE_PARM_DESC (compat_ddr_negotiate,"Attempt pre-IBTA 1.2 DDR speed negotiation")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_AUTHOR ("QLogic <support@qlogic.com>")
 
 MODULE_DESCRIPTION ("QLogic IB driver")
 
 MODULE_VERSION (QIB_DRIVER_VERSION)
 
const charqib_get_unit_name (int unit)
 
int qib_count_active_units (void)
 
int qib_count_units (int *npresentp, int *nupp)
 
int qib_wait_linkstate (struct qib_pportdata *ppd, u32 state, int msecs)
 
int qib_set_linkstate (struct qib_pportdata *ppd, u8 newstate)
 
u32 qib_kreceive (struct qib_ctxtdata *rcd, u32 *llic, u32 *npkts)
 
int qib_set_mtu (struct qib_pportdata *ppd, u16 arg)
 
int qib_set_lid (struct qib_pportdata *ppd, u32 lid, u8 lmc)
 
void qib_set_led_override (struct qib_pportdata *ppd, unsigned int val)
 
int qib_reset_device (int unit)
 

Variables

const char ib_qib_version [] = QIB_DRIVER_VERSION "\n"
 
unsigned qib_ibmtu
 
unsigned qib_compat_ddr_negotiate = 1
 
struct qlogic_ib_stats qib_stats
 

Macro Definition Documentation

#define LED_OVER_BOTH_OFF   (8)

Definition at line 676 of file qib_driver.c.

#define LED_OVER_FREQ_MASK   (0xFF<<LED_OVER_FREQ_SHIFT)

Definition at line 674 of file qib_driver.c.

#define LED_OVER_FREQ_SHIFT   8

Definition at line 673 of file qib_driver.c.

#define QIB_MAX_PKT_RECV   64

Definition at line 80 of file qib_driver.c.

#define QIB_PIO_MAXIBHDR   128

Definition at line 75 of file qib_driver.c.

Function Documentation

DEFINE_MUTEX ( qib_mutex  )
DEFINE_SPINLOCK ( qib_devs_lock  )
LIST_HEAD ( qib_dev_list  )
MODULE_AUTHOR ( "QLogic <support@qlogic.com>"  )
MODULE_DESCRIPTION ( "QLogic IB driver )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param_named ( ibmtu  ,
qib_ibmtu  ,
uint  ,
S_IRUGO   
)
module_param_named ( compat_ddr_negotiate  ,
qib_compat_ddr_negotiate  ,
uint  ,
S_IWUSR S_IRUGO 
)
MODULE_PARM_DESC ( ibmtu  )
MODULE_PARM_DESC ( compat_ddr_negotiate  ,
"Attempt pre-IBTA 1.2 DDR speed negotiation"   
)
MODULE_VERSION ( QIB_DRIVER_VERSION  )
int qib_count_active_units ( void  )

Definition at line 95 of file qib_driver.c.

int qib_count_units ( int npresentp,
int nupp 
)

Definition at line 124 of file qib_driver.c.

const char* qib_get_unit_name ( int  unit)

Definition at line 84 of file qib_driver.c.

u32 qib_kreceive ( struct qib_ctxtdata rcd,
u32 llic,
u32 npkts 
)

Definition at line 444 of file qib_driver.c.

int qib_reset_device ( int  unit)

qib_reset_device - reset the chip if possible : the device to reset

Whether or not reset is successful, we attempt to re-initialize the chip (that is, much like a driver unload/reload). We clear the INITTED flag so that the various entry points will fail until we reinitialize. For now, we only allow this if no user contexts are open that use chip resources

Definition at line 752 of file qib_driver.c.

void qib_set_led_override ( struct qib_pportdata ppd,
unsigned int  val 
)

Definition at line 701 of file qib_driver.c.

int qib_set_lid ( struct qib_pportdata ppd,
u32  lid,
u8  lmc 
)

Definition at line 651 of file qib_driver.c.

int qib_set_linkstate ( struct qib_pportdata ppd,
u8  newstate 
)

Definition at line 196 of file qib_driver.c.

int qib_set_mtu ( struct qib_pportdata ppd,
u16  arg 
)

qib_set_mtu - set the MTU : the perport data

  • : the new MTU

We can handle "any" incoming size, the issue here is whether we need to restrict our outgoing size. For now, we don't do any sanity checking on this, and we don't deal with what happens to programs that are already running when the size changes. NOTE: changing the MTU will usually cause the IBC to go back to link INIT state...

Definition at line 612 of file qib_driver.c.

int qib_wait_linkstate ( struct qib_pportdata ppd,
u32  state,
int  msecs 
)

qib_wait_linkstate - wait for an IB link state change to occur : the qlogic_ib device : the state to wait for : the number of milliseconds to wait

wait up to msecs milliseconds for IB link state change to occur for now, take the easy polling route. Currently used only by qib_set_linkstate. Returns 0 if state reached, otherwise -ETIMEDOUT state can have multiple states set, for any of several transitions.

Definition at line 168 of file qib_driver.c.

Variable Documentation

const char ib_qib_version[] = QIB_DRIVER_VERSION "\n"

Definition at line 49 of file qib_driver.c.

unsigned qib_compat_ddr_negotiate = 1

Definition at line 59 of file qib_driver.c.

unsigned qib_ibmtu

Definition at line 55 of file qib_driver.c.

Definition at line 82 of file qib_driver.c.