Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
device.c File Reference
#include <linux/module.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <rdma/rdma_netlink.h>
#include "core_priv.h"

Go to the source code of this file.

Data Structures

struct  ib_client_data
 

Macros

#define IB_MANDATORY_FUNC(x)   { offsetof(struct ib_device, x), #x }
 

Functions

 MODULE_AUTHOR ("Roland Dreier")
 
 MODULE_DESCRIPTION ("core kernel InfiniBand API")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 EXPORT_SYMBOL_GPL (ib_wq)
 
struct ib_deviceib_alloc_device (size_t size)
 
 EXPORT_SYMBOL (ib_alloc_device)
 
void ib_dealloc_device (struct ib_device *device)
 
 EXPORT_SYMBOL (ib_dealloc_device)
 
int ib_register_device (struct ib_device *device, int(*port_callback)(struct ib_device *, u8, struct kobject *))
 
 EXPORT_SYMBOL (ib_register_device)
 
void ib_unregister_device (struct ib_device *device)
 
 EXPORT_SYMBOL (ib_unregister_device)
 
int ib_register_client (struct ib_client *client)
 
 EXPORT_SYMBOL (ib_register_client)
 
void ib_unregister_client (struct ib_client *client)
 
 EXPORT_SYMBOL (ib_unregister_client)
 
voidib_get_client_data (struct ib_device *device, struct ib_client *client)
 
 EXPORT_SYMBOL (ib_get_client_data)
 
void ib_set_client_data (struct ib_device *device, struct ib_client *client, void *data)
 
 EXPORT_SYMBOL (ib_set_client_data)
 
int ib_register_event_handler (struct ib_event_handler *event_handler)
 
 EXPORT_SYMBOL (ib_register_event_handler)
 
int ib_unregister_event_handler (struct ib_event_handler *event_handler)
 
 EXPORT_SYMBOL (ib_unregister_event_handler)
 
void ib_dispatch_event (struct ib_event *event)
 
 EXPORT_SYMBOL (ib_dispatch_event)
 
int ib_query_device (struct ib_device *device, struct ib_device_attr *device_attr)
 
 EXPORT_SYMBOL (ib_query_device)
 
int ib_query_port (struct ib_device *device, u8 port_num, struct ib_port_attr *port_attr)
 
 EXPORT_SYMBOL (ib_query_port)
 
int ib_query_gid (struct ib_device *device, u8 port_num, int index, union ib_gid *gid)
 
 EXPORT_SYMBOL (ib_query_gid)
 
int ib_query_pkey (struct ib_device *device, u8 port_num, u16 index, u16 *pkey)
 
 EXPORT_SYMBOL (ib_query_pkey)
 
int ib_modify_device (struct ib_device *device, int device_modify_mask, struct ib_device_modify *device_modify)
 
 EXPORT_SYMBOL (ib_modify_device)
 
int ib_modify_port (struct ib_device *device, u8 port_num, int port_modify_mask, struct ib_port_modify *port_modify)
 
 EXPORT_SYMBOL (ib_modify_port)
 
int ib_find_gid (struct ib_device *device, union ib_gid *gid, u8 *port_num, u16 *index)
 
 EXPORT_SYMBOL (ib_find_gid)
 
int ib_find_pkey (struct ib_device *device, u8 port_num, u16 pkey, u16 *index)
 
 EXPORT_SYMBOL (ib_find_pkey)
 
 module_init (ib_core_init)
 
 module_exit (ib_core_cleanup)
 

Variables

struct workqueue_structib_wq
 

Macro Definition Documentation

#define IB_MANDATORY_FUNC (   x)    { offsetof(struct ib_device, x), #x }

Function Documentation

EXPORT_SYMBOL ( ib_alloc_device  )
EXPORT_SYMBOL ( ib_dealloc_device  )
EXPORT_SYMBOL ( ib_register_device  )
EXPORT_SYMBOL ( ib_unregister_device  )
EXPORT_SYMBOL ( ib_register_client  )
EXPORT_SYMBOL ( ib_unregister_client  )
EXPORT_SYMBOL ( ib_get_client_data  )
EXPORT_SYMBOL ( ib_set_client_data  )
EXPORT_SYMBOL ( ib_register_event_handler  )
EXPORT_SYMBOL ( ib_unregister_event_handler  )
EXPORT_SYMBOL ( ib_dispatch_event  )
EXPORT_SYMBOL ( ib_query_device  )
EXPORT_SYMBOL ( ib_query_port  )
EXPORT_SYMBOL ( ib_query_gid  )
EXPORT_SYMBOL ( ib_query_pkey  )
EXPORT_SYMBOL ( ib_modify_device  )
EXPORT_SYMBOL ( ib_modify_port  )
EXPORT_SYMBOL ( ib_find_gid  )
EXPORT_SYMBOL ( ib_find_pkey  )
EXPORT_SYMBOL_GPL ( ib_wq  )
struct ib_device* ib_alloc_device ( size_t  size)
read

ib_alloc_device - allocate an IB device struct :size of structure to allocate

Low-level drivers should use ib_alloc_device() to allocate &struct ib_device. is the size of the structure to be allocated, including any private data used by the low-level driver. ib_dealloc_device() must be used to free structures allocated with ib_alloc_device().

Definition at line 176 of file device.c.

void ib_dealloc_device ( struct ib_device device)

ib_dealloc_device - free an IB device struct :structure to free

Free a structure allocated with ib_alloc_device().

Definition at line 190 of file device.c.

void ib_dispatch_event ( struct ib_event event)

ib_dispatch_event - Dispatch an asynchronous event :Event to dispatch

Low-level drivers must call ib_dispatch_event() to dispatch the event to all registered event handlers when an asynchronous event occurs.

Definition at line 536 of file device.c.

int ib_find_gid ( struct ib_device device,
union ib_gid gid,
u8 port_num,
u16 index 
)

ib_find_gid - Returns the port number and GID table index where a specified GID value occurs. : The device to query. : The GID value to search for. : The port number of the device where the GID value was found. : The index into the GID table where the GID was found. This parameter may be NULL.

Definition at line 673 of file device.c.

int ib_find_pkey ( struct ib_device device,
u8  port_num,
u16  pkey,
u16 index 
)

ib_find_pkey - Returns the PKey table index where a specified PKey value occurs. : The device to query. : The port number of the device to search for the PKey. : The PKey value to search for. : The index into the PKey table where the PKey was found.

Definition at line 705 of file device.c.

void* ib_get_client_data ( struct ib_device device,
struct ib_client client 
)

ib_get_client_data - Get IB client context :Device to get context for :Client to get context for

ib_get_client_data() returns client context set with ib_set_client_data().

Definition at line 439 of file device.c.

int ib_modify_device ( struct ib_device device,
int  device_modify_mask,
struct ib_device_modify device_modify 
)

ib_modify_device - Change IB device attributes :Device to modify :Mask of attributes to change :New attribute values

ib_modify_device() changes a device's attributes as specified by the and structure.

Definition at line 626 of file device.c.

int ib_modify_port ( struct ib_device device,
u8  port_num,
int  port_modify_mask,
struct ib_port_modify port_modify 
)

ib_modify_port - Modifies the attributes for the specified port. : The device to modify. : The number of the port to modify. : Mask used to specify which attributes of the port to change. : New attribute values for the port.

ib_modify_port() changes a port's attributes as specified by the and structure.

Definition at line 649 of file device.c.

int ib_query_device ( struct ib_device device,
struct ib_device_attr device_attr 
)

ib_query_device - Query IB device attributes :Device to query :Device attributes

ib_query_device() returns the attributes of a device through the pointer.

Definition at line 558 of file device.c.

int ib_query_gid ( struct ib_device device,
u8  port_num,
int  index,
union ib_gid gid 
)

ib_query_gid - Get GID table entry :Device to query :Port number to query :GID table index to query :Returned GID

ib_query_gid() fetches the specified GID table entry.

Definition at line 594 of file device.c.

int ib_query_pkey ( struct ib_device device,
u8  port_num,
u16  index,
u16 pkey 
)

ib_query_pkey - Get P_Key table entry :Device to query :Port number to query :P_Key table index to query :Returned P_Key

ib_query_pkey() fetches the specified P_Key table entry.

Definition at line 610 of file device.c.

int ib_query_port ( struct ib_device device,
u8  port_num,
struct ib_port_attr port_attr 
)

ib_query_port - Query IB port attributes :Device to query :Port number to query :Port attributes

ib_query_port() returns the attributes of a port through the pointer.

Definition at line 574 of file device.c.

int ib_register_client ( struct ib_client client)

ib_register_client - Register an IB client :Client to register

Upper level users of the IB drivers can use ib_register_client() to register callbacks for IB device addition and removal. When an IB device is added, each registered client's add method will be called (in the order the clients were registered), and when a device is removed, each client's remove method will be called (in the reverse order that clients were registered). In addition, when ib_register_client() is called, the client will receive an add callback for all devices already registered.

Definition at line 380 of file device.c.

int ib_register_device ( struct ib_device device,
int(*)(struct ib_device *, u8, struct kobject *)  port_callback 
)

ib_register_device - Register an IB device with IB core :Device to register

Low-level drivers use ib_register_device() to register their devices with the IB core. All registered clients will receive a callback for each device that is added. must be allocated with ib_alloc_device().

Definition at line 273 of file device.c.

int ib_register_event_handler ( struct ib_event_handler event_handler)

ib_register_event_handler - Register an IB event handler :Handler to register

ib_register_event_handler() registers an event handler that will be called back when asynchronous IB events occur (as defined in chapter 11 of the InfiniBand Architecture Specification). This callback may occur in interrupt context.

Definition at line 496 of file device.c.

void ib_set_client_data ( struct ib_device device,
struct ib_client client,
void data 
)

ib_set_client_data - Set IB client context :Device to set context for :Client to set context for :Context to set

ib_set_client_data() sets client context that can be retrieved with ib_get_client_data().

Definition at line 466 of file device.c.

void ib_unregister_client ( struct ib_client client)

ib_unregister_client - Unregister an IB client :Client to unregister

Upper level users use ib_unregister_client() to remove their client registration. When ib_unregister_client() is called, the client will receive a remove callback for each IB device still registered.

Definition at line 405 of file device.c.

void ib_unregister_device ( struct ib_device device)

ib_unregister_device - Unregister an IB device :Device to unregister

Unregister an IB device. All clients will receive a remove callback.

Definition at line 337 of file device.c.

int ib_unregister_event_handler ( struct ib_event_handler event_handler)

ib_unregister_event_handler - Unregister an event handler :Handler to unregister

Unregister an event handler registered with ib_register_event_handler().

Definition at line 516 of file device.c.

MODULE_AUTHOR ( "Roland Dreier"  )
MODULE_DESCRIPTION ( "core kernel InfiniBand API"  )
module_exit ( ib_core_cleanup  )
module_init ( ib_core_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )

Variable Documentation

Definition at line 55 of file device.c.