Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
scsi_transport_srp.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_srp.h>
#include "scsi_transport_srp_internal.h"

Go to the source code of this file.

Data Structures

struct  srp_host_attrs
struct  srp_internal


#define to_srp_host_attrs(host)   ((struct srp_host_attrs *)(host)->shost_data)
#define SRP_HOST_ATTRS   0
#define SRP_RPORT_ATTRS   2
#define to_srp_internal(tmpl)   container_of(tmpl, struct srp_internal, t)
#define dev_to_rport(d)   container_of(d, struct srp_rport, dev)
#define transport_class_to_srp_rport(dev)   dev_to_rport((dev)->parent)
#define SETUP_TEMPLATE(attrb, field, perm, test, ro_test, ro_perm)
#define SETUP_RPORT_ATTRIBUTE_RD(field)   SETUP_TEMPLATE(rport_attrs, field, S_IRUGO, 1, 0, 0)
#define SRP_PID(p)
#define SRP_PID_FMT


struct srp_rportsrp_rport_add (struct Scsi_Host *shost, struct srp_rport_identifiers *ids)
 EXPORT_SYMBOL_GPL (srp_rport_add)
void srp_rport_del (struct srp_rport *rport)
 EXPORT_SYMBOL_GPL (srp_rport_del)
void srp_remove_host (struct Scsi_Host *shost)
 EXPORT_SYMBOL_GPL (srp_remove_host)
struct scsi_transport_templatesrp_attach_transport (struct srp_function_template *ft)
 EXPORT_SYMBOL_GPL (srp_attach_transport)
void srp_release_transport (struct scsi_transport_template *t)
 EXPORT_SYMBOL_GPL (srp_release_transport)
 MODULE_DESCRIPTION ("SRP Transport Attributes")
 module_init (srp_transport_init)
 module_exit (srp_transport_exit)

Macro Definition Documentation

#define dev_to_rport (   d)    container_of(d, struct srp_rport, dev)

Definition at line 56 of file scsi_transport_srp.c.

#define SETUP_RPORT_ATTRIBUTE_RD (   field)    SETUP_TEMPLATE(rport_attrs, field, S_IRUGO, 1, 0, 0)

Definition at line 86 of file scsi_transport_srp.c.

#define SETUP_RPORT_ATTRIBUTE_RW (   field)
SETUP_TEMPLATE(rport_attrs, field, S_IRUGO | S_IWUSR, \
1, 1, S_IRUGO)

Definition at line 89 of file scsi_transport_srp.c.

#define SETUP_TEMPLATE (   attrb,
i->private_##attrb[count] = dev_attr_##field; \
i->private_##attrb[count].attr.mode = perm; \
if (ro_test) { \
i->private_##attrb[count].attr.mode = ro_perm; \
i->private_##attrb[count].store = NULL; \
} \
i->attrb[count] = &i->private_##attrb[count]; \
if (test) \

Definition at line 75 of file scsi_transport_srp.c.

#define SRP_HOST_ATTRS   0

Definition at line 40 of file scsi_transport_srp.c.

#define SRP_PID (   p)
(p)->port_id[0], (p)->port_id[1], (p)->port_id[2], (p)->port_id[3], \
(p)->port_id[4], (p)->port_id[5], (p)->port_id[6], (p)->port_id[7], \
(p)->port_id[8], (p)->port_id[9], (p)->port_id[10], (p)->port_id[11], \
(p)->port_id[12], (p)->port_id[13], (p)->port_id[14], (p)->port_id[15]

Definition at line 93 of file scsi_transport_srp.c.

#define SRP_PID_FMT
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" \

Definition at line 99 of file scsi_transport_srp.c.

#define SRP_RPORT_ATTRS   2

Definition at line 41 of file scsi_transport_srp.c.

#define to_srp_host_attrs (   host)    ((struct srp_host_attrs *)(host)->shost_data)

Definition at line 38 of file scsi_transport_srp.c.

#define to_srp_internal (   tmpl)    container_of(tmpl, struct srp_internal, t)

Definition at line 54 of file scsi_transport_srp.c.

#define transport_class_to_srp_rport (   dev)    dev_to_rport((dev)->parent)

Definition at line 57 of file scsi_transport_srp.c.

Function Documentation

EXPORT_SYMBOL_GPL ( srp_rport_add  )
EXPORT_SYMBOL_GPL ( srp_rport_del  )
EXPORT_SYMBOL_GPL ( srp_remove_host  )
EXPORT_SYMBOL_GPL ( srp_attach_transport  )
EXPORT_SYMBOL_GPL ( srp_release_transport  )
MODULE_DESCRIPTION ( "SRP Transport Attributes )
module_exit ( srp_transport_exit  )
module_init ( srp_transport_init  )
struct scsi_transport_template* srp_attach_transport ( struct srp_function_template ft)

srp_attach_transport - instantiate SRP transport template : SRP transport class function template

Definition at line 305 of file scsi_transport_srp.c.

void srp_release_transport ( struct scsi_transport_template t)

srp_release_transport - release SRP transport template instance : transport template instance

Definition at line 344 of file scsi_transport_srp.c.

void srp_remove_host ( struct Scsi_Host shost)

srp_remove_host - tear down a Scsi_Host's SRP data structures : Scsi Host that is torn down

Removes all SRP remote ports for a given Scsi_Host. Must be called just before scsi_remove_host for SRP HBAs.

Definition at line 281 of file scsi_transport_srp.c.

struct srp_rport* srp_rport_add ( struct Scsi_Host shost,
struct srp_rport_identifiers ids 

srp_rport_add - add a SRP remote port to the device hierarchy : scsi host the remote port is connected to. : The port id for the remote port.

Publishes a port to the rest of the system.

Definition at line 195 of file scsi_transport_srp.c.

void srp_rport_del ( struct srp_rport rport)

srp_rport_del - remove a SRP remote port : SRP remote port to remove

Removes the specified SRP remote port.

Definition at line 251 of file scsi_transport_srp.c.

Variable Documentation

char* name

Definition at line 114 of file scsi_transport_srp.c.

u32 value

Definition at line 113 of file scsi_transport_srp.c.