Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ipack.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/idr.h>
#include <asm/io.h>
#include "ipack.h"

Go to the source code of this file.

Macros

#define to_ipack_dev(device)   container_of(device, struct ipack_device, dev)
 
#define to_ipack_driver(drv)   container_of(drv, struct ipack_driver, driver)
 
#define ipack_uevent   NULL
 
#define ipack_device_attr(field, format_string)
 

Functions

 ipack_device_attr (id_format,"0x%hhu\n")
 
struct ipack_bus_deviceipack_bus_register (struct device *parent, int slots, const struct ipack_bus_ops *ops)
 
 EXPORT_SYMBOL_GPL (ipack_bus_register)
 
int ipack_bus_unregister (struct ipack_bus_device *bus)
 
 EXPORT_SYMBOL_GPL (ipack_bus_unregister)
 
int ipack_driver_register (struct ipack_driver *edrv, struct module *owner, const char *name)
 
 EXPORT_SYMBOL_GPL (ipack_driver_register)
 
void ipack_driver_unregister (struct ipack_driver *edrv)
 
 EXPORT_SYMBOL_GPL (ipack_driver_unregister)
 
struct ipack_deviceipack_device_register (struct ipack_bus_device *bus, int slot)
 
 EXPORT_SYMBOL_GPL (ipack_device_register)
 
void ipack_device_unregister (struct ipack_device *dev)
 
 EXPORT_SYMBOL_GPL (ipack_device_unregister)
 
 module_init (ipack_init)
 
 module_exit (ipack_exit)
 
 MODULE_AUTHOR ("Samuel Iglesias Gonsalvez <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Industry-pack bus core")
 

Macro Definition Documentation

#define ipack_device_attr (   field,
  format_string 
)
Value:
static ssize_t \
field##_show(struct device *dev, struct device_attribute *attr, \
char *buf) \
{ \
return sprintf(buf, format_string, idev->field); \
}

Definition at line 113 of file ipack.c.

#define ipack_uevent   NULL

Definition at line 109 of file ipack.c.

#define to_ipack_dev (   device)    container_of(device, struct ipack_device, dev)

Definition at line 18 of file ipack.c.

#define to_ipack_driver (   drv)    container_of(drv, struct ipack_driver, driver)

Definition at line 19 of file ipack.c.

Function Documentation

EXPORT_SYMBOL_GPL ( ipack_bus_register  )
EXPORT_SYMBOL_GPL ( ipack_bus_unregister  )
EXPORT_SYMBOL_GPL ( ipack_driver_register  )
EXPORT_SYMBOL_GPL ( ipack_driver_unregister  )
EXPORT_SYMBOL_GPL ( ipack_device_register  )
EXPORT_SYMBOL_GPL ( ipack_device_unregister  )
struct ipack_bus_device* ipack_bus_register ( struct device parent,
int  slots,
const struct ipack_bus_ops ops 
)
read

ipack_bus_register – register a new ipack bus

: pointer to the parent device, if any. : number of slots available in the bus device. : bus operations for the mezzanine drivers.

The carrier board device should call this function to register itself as available bus device in ipack.

Definition at line 208 of file ipack.c.

int ipack_bus_unregister ( struct ipack_bus_device bus)

ipack_bus_unregister – unregister an ipack bus

Definition at line 243 of file ipack.c.

ipack_device_attr ( id_format  ,
"0x%hhu\n"   
)
struct ipack_device* ipack_device_register ( struct ipack_bus_device bus,
int  slot 
)
read

ipack_device_register – register a new mezzanine device

: ipack bus device it is plugged to. : slot position in the bus device.

Register a new ipack device (mezzanine device). The call is done by the carrier device driver.

Definition at line 429 of file ipack.c.

void ipack_device_unregister ( struct ipack_device dev)

Definition at line 478 of file ipack.c.

int ipack_driver_register ( struct ipack_driver edrv,
struct module owner,
const char name 
)

ipack_driver_register – Register a new driver

Called by a ipack driver to register itself as a driver that can manage ipack devices.

Definition at line 252 of file ipack.c.

void ipack_driver_unregister ( struct ipack_driver edrv)

Definition at line 262 of file ipack.c.

MODULE_AUTHOR ( "Samuel Iglesias Gonsalvez <[email protected]>"  )
MODULE_DESCRIPTION ( "Industry-pack bus core )
module_exit ( ipack_exit  )
module_init ( ipack_init  )
MODULE_LICENSE ( "GPL"  )