Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
iscsi_boot_sysfs.c File Reference
#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/capability.h>
#include <linux/iscsi_boot_sysfs.h>

Go to the source code of this file.

Data Structures

struct  iscsi_boot_attr
 

Macros

#define iscsi_boot_rd_attr(fnname, sysfs_name, attr_type)
 

Functions

 MODULE_AUTHOR ("Mike Christie <[email protected]>")
 
 MODULE_DESCRIPTION ("sysfs interface and helpers to export iSCSI boot information")
 
 MODULE_LICENSE ("GPL")
 
 iscsi_boot_rd_attr (tgt_index, index, ISCSI_BOOT_TGT_INDEX)
 
 iscsi_boot_rd_attr (tgt_flags, flags, ISCSI_BOOT_TGT_FLAGS)
 
 iscsi_boot_rd_attr (tgt_ip, ip-addr, ISCSI_BOOT_TGT_IP_ADDR)
 
 iscsi_boot_rd_attr (tgt_port, port, ISCSI_BOOT_TGT_PORT)
 
 iscsi_boot_rd_attr (tgt_lun, lun, ISCSI_BOOT_TGT_LUN)
 
 iscsi_boot_rd_attr (tgt_chap, chap-type, ISCSI_BOOT_TGT_CHAP_TYPE)
 
 iscsi_boot_rd_attr (tgt_nic, nic-assoc, ISCSI_BOOT_TGT_NIC_ASSOC)
 
 iscsi_boot_rd_attr (tgt_name, target-name, ISCSI_BOOT_TGT_NAME)
 
 iscsi_boot_rd_attr (tgt_chap_name, chap-name, ISCSI_BOOT_TGT_CHAP_NAME)
 
 iscsi_boot_rd_attr (tgt_chap_secret, chap-secret, ISCSI_BOOT_TGT_CHAP_SECRET)
 
 iscsi_boot_rd_attr (tgt_chap_rev_name, rev-chap-name, ISCSI_BOOT_TGT_REV_CHAP_NAME)
 
 iscsi_boot_rd_attr (tgt_chap_rev_secret, rev-chap-name-secret, ISCSI_BOOT_TGT_REV_CHAP_SECRET)
 
 iscsi_boot_rd_attr (eth_index, index, ISCSI_BOOT_ETH_INDEX)
 
 iscsi_boot_rd_attr (eth_flags, flags, ISCSI_BOOT_ETH_FLAGS)
 
 iscsi_boot_rd_attr (eth_ip, ip-addr, ISCSI_BOOT_ETH_IP_ADDR)
 
 iscsi_boot_rd_attr (eth_subnet, subnet-mask, ISCSI_BOOT_ETH_SUBNET_MASK)
 
 iscsi_boot_rd_attr (eth_origin, origin, ISCSI_BOOT_ETH_ORIGIN)
 
 iscsi_boot_rd_attr (eth_gateway, gateway, ISCSI_BOOT_ETH_GATEWAY)
 
 iscsi_boot_rd_attr (eth_primary_dns, primary-dns, ISCSI_BOOT_ETH_PRIMARY_DNS)
 
 iscsi_boot_rd_attr (eth_secondary_dns, secondary-dns, ISCSI_BOOT_ETH_SECONDARY_DNS)
 
 iscsi_boot_rd_attr (eth_dhcp, dhcp, ISCSI_BOOT_ETH_DHCP)
 
 iscsi_boot_rd_attr (eth_vlan, vlan, ISCSI_BOOT_ETH_VLAN)
 
 iscsi_boot_rd_attr (eth_mac, mac, ISCSI_BOOT_ETH_MAC)
 
 iscsi_boot_rd_attr (eth_hostname, hostname, ISCSI_BOOT_ETH_HOSTNAME)
 
 iscsi_boot_rd_attr (ini_index, index, ISCSI_BOOT_INI_INDEX)
 
 iscsi_boot_rd_attr (ini_flags, flags, ISCSI_BOOT_INI_FLAGS)
 
 iscsi_boot_rd_attr (ini_isns, isns-server, ISCSI_BOOT_INI_ISNS_SERVER)
 
 iscsi_boot_rd_attr (ini_slp, slp-server, ISCSI_BOOT_INI_SLP_SERVER)
 
 iscsi_boot_rd_attr (ini_primary_radius, pri-radius-server, ISCSI_BOOT_INI_PRI_RADIUS_SERVER)
 
 iscsi_boot_rd_attr (ini_secondary_radius, sec-radius-server, ISCSI_BOOT_INI_SEC_RADIUS_SERVER)
 
 iscsi_boot_rd_attr (ini_name, initiator-name, ISCSI_BOOT_INI_INITIATOR_NAME)
 
struct iscsi_boot_kobjiscsi_boot_create_target (struct iscsi_boot_kset *boot_kset, int index, void *data, ssize_t(*show)(void *data, int type, char *buf), umode_t(*is_visible)(void *data, int type), void(*release)(void *data))
 
 EXPORT_SYMBOL_GPL (iscsi_boot_create_target)
 
struct iscsi_boot_kobjiscsi_boot_create_initiator (struct iscsi_boot_kset *boot_kset, int index, void *data, ssize_t(*show)(void *data, int type, char *buf), umode_t(*is_visible)(void *data, int type), void(*release)(void *data))
 
 EXPORT_SYMBOL_GPL (iscsi_boot_create_initiator)
 
struct iscsi_boot_kobjiscsi_boot_create_ethernet (struct iscsi_boot_kset *boot_kset, int index, void *data, ssize_t(*show)(void *data, int type, char *buf), umode_t(*is_visible)(void *data, int type), void(*release)(void *data))
 
 EXPORT_SYMBOL_GPL (iscsi_boot_create_ethernet)
 
struct iscsi_boot_ksetiscsi_boot_create_kset (const char *set_name)
 
 EXPORT_SYMBOL_GPL (iscsi_boot_create_kset)
 
struct iscsi_boot_ksetiscsi_boot_create_host_kset (unsigned int hostno)
 
 EXPORT_SYMBOL_GPL (iscsi_boot_create_host_kset)
 
void iscsi_boot_destroy_kset (struct iscsi_boot_kset *boot_kset)
 
 EXPORT_SYMBOL_GPL (iscsi_boot_destroy_kset)
 

Macro Definition Documentation

#define iscsi_boot_rd_attr (   fnname,
  sysfs_name,
  attr_type 
)
Value:
static struct iscsi_boot_attr iscsi_boot_attr_##fnname = { \
.attr = { .name = __stringify(sysfs_name), .mode = 0444 }, \
.type = attr_type, \
}

Definition at line 77 of file iscsi_boot_sysfs.c.

Function Documentation

EXPORT_SYMBOL_GPL ( iscsi_boot_create_target  )
EXPORT_SYMBOL_GPL ( iscsi_boot_create_initiator  )
EXPORT_SYMBOL_GPL ( iscsi_boot_create_ethernet  )
EXPORT_SYMBOL_GPL ( iscsi_boot_create_kset  )
EXPORT_SYMBOL_GPL ( iscsi_boot_create_host_kset  )
EXPORT_SYMBOL_GPL ( iscsi_boot_destroy_kset  )
struct iscsi_boot_kobj* iscsi_boot_create_ethernet ( struct iscsi_boot_kset boot_kset,
int  index,
void data,
ssize_t(*)(void *data, int type, char *buf show,
umode_t(*)(void *data, int type is_visible,
void(*)(void *data release 
)
read

iscsi_boot_create_ethernet() - create boot ethernet sysfs dir : boot kset : the ethernet device id : driver specific data : attr show function : attr visibility function : release function

Note: The boot sysfs lib will free the data passed in for the caller when all refs to the ethernet kobject have been released.

Definition at line 420 of file iscsi_boot_sysfs.c.

struct iscsi_boot_kset* iscsi_boot_create_host_kset ( unsigned int  hostno)
read

iscsi_boot_create_host_kset() - creates root sysfs tree for a scsi host : host number of scsi host

Definition at line 460 of file iscsi_boot_sysfs.c.

struct iscsi_boot_kobj* iscsi_boot_create_initiator ( struct iscsi_boot_kset boot_kset,
int  index,
void data,
ssize_t(*)(void *data, int type, char *buf show,
umode_t(*)(void *data, int type is_visible,
void(*)(void *data release 
)
read

iscsi_boot_create_initiator() - create boot initiator sysfs dir : boot kset : the initiator id : driver specific data : attr show function : attr visibility function : release function

Note: The boot sysfs lib will free the data passed in for the caller when all refs to the initiator kobject have been released.

Definition at line 394 of file iscsi_boot_sysfs.c.

struct iscsi_boot_kset* iscsi_boot_create_kset ( const char set_name)
read

iscsi_boot_create_kset() - creates root sysfs tree : name of root dir

Definition at line 437 of file iscsi_boot_sysfs.c.

struct iscsi_boot_kobj* iscsi_boot_create_target ( struct iscsi_boot_kset boot_kset,
int  index,
void data,
ssize_t(*)(void *data, int type, char *buf show,
umode_t(*)(void *data, int type is_visible,
void(*)(void *data release 
)
read

iscsi_boot_create_target() - create boot target sysfs dir : boot kset : the target id : driver specific data for target : attr show function : attr visibility function : release function

Note: The boot sysfs lib will free the data passed in for the caller when all refs to the target kobject have been released.

Definition at line 369 of file iscsi_boot_sysfs.c.

void iscsi_boot_destroy_kset ( struct iscsi_boot_kset boot_kset)

iscsi_boot_destroy_kset() - destroy kset and kobjects under it : boot kset

This will remove the kset and kobjects and attrs under it.

Definition at line 481 of file iscsi_boot_sysfs.c.

iscsi_boot_rd_attr ( tgt_index  ,
index  ,
ISCSI_BOOT_TGT_INDEX   
)
iscsi_boot_rd_attr ( tgt_flags  ,
flags  ,
ISCSI_BOOT_TGT_FLAGS   
)
iscsi_boot_rd_attr ( tgt_ip  ,
ip addr,
ISCSI_BOOT_TGT_IP_ADDR   
)
iscsi_boot_rd_attr ( tgt_port  ,
port  ,
ISCSI_BOOT_TGT_PORT   
)
iscsi_boot_rd_attr ( tgt_lun  ,
lun  ,
ISCSI_BOOT_TGT_LUN   
)
iscsi_boot_rd_attr ( tgt_chap  ,
chap-  type,
ISCSI_BOOT_TGT_CHAP_TYPE   
)
iscsi_boot_rd_attr ( tgt_nic  ,
nic-  assoc,
ISCSI_BOOT_TGT_NIC_ASSOC   
)
iscsi_boot_rd_attr ( tgt_name  ,
target name,
ISCSI_BOOT_TGT_NAME   
)
iscsi_boot_rd_attr ( tgt_chap_name  ,
chap-  name,
ISCSI_BOOT_TGT_CHAP_NAME   
)
iscsi_boot_rd_attr ( tgt_chap_secret  ,
chap-  secret,
ISCSI_BOOT_TGT_CHAP_SECRET   
)
iscsi_boot_rd_attr ( tgt_chap_rev_name  ,
rev-chap-  name,
ISCSI_BOOT_TGT_REV_CHAP_NAME   
)
iscsi_boot_rd_attr ( tgt_chap_rev_secret  ,
rev-chap-name secret,
ISCSI_BOOT_TGT_REV_CHAP_SECRET   
)
iscsi_boot_rd_attr ( eth_index  ,
index  ,
ISCSI_BOOT_ETH_INDEX   
)
iscsi_boot_rd_attr ( eth_flags  ,
flags  ,
ISCSI_BOOT_ETH_FLAGS   
)
iscsi_boot_rd_attr ( eth_ip  ,
ip addr,
ISCSI_BOOT_ETH_IP_ADDR   
)
iscsi_boot_rd_attr ( eth_subnet  ,
subnet-  mask,
ISCSI_BOOT_ETH_SUBNET_MASK   
)
iscsi_boot_rd_attr ( eth_origin  ,
origin  ,
ISCSI_BOOT_ETH_ORIGIN   
)
iscsi_boot_rd_attr ( eth_gateway  ,
gateway  ,
ISCSI_BOOT_ETH_GATEWAY   
)
iscsi_boot_rd_attr ( eth_primary_dns  ,
primary dns,
ISCSI_BOOT_ETH_PRIMARY_DNS   
)
iscsi_boot_rd_attr ( eth_secondary_dns  ,
secondary-  dns,
ISCSI_BOOT_ETH_SECONDARY_DNS   
)
iscsi_boot_rd_attr ( eth_dhcp  ,
dhcp  ,
ISCSI_BOOT_ETH_DHCP   
)
iscsi_boot_rd_attr ( eth_vlan  ,
vlan  ,
ISCSI_BOOT_ETH_VLAN   
)
iscsi_boot_rd_attr ( eth_mac  ,
mac  ,
ISCSI_BOOT_ETH_MAC   
)
iscsi_boot_rd_attr ( eth_hostname  ,
hostname  ,
ISCSI_BOOT_ETH_HOSTNAME   
)
iscsi_boot_rd_attr ( ini_index  ,
index  ,
ISCSI_BOOT_INI_INDEX   
)
iscsi_boot_rd_attr ( ini_flags  ,
flags  ,
ISCSI_BOOT_INI_FLAGS   
)
iscsi_boot_rd_attr ( ini_isns  ,
isns-  server,
ISCSI_BOOT_INI_ISNS_SERVER   
)
iscsi_boot_rd_attr ( ini_slp  ,
slp-  server,
ISCSI_BOOT_INI_SLP_SERVER   
)
iscsi_boot_rd_attr ( ini_primary_radius  ,
pri-radius-  server,
ISCSI_BOOT_INI_PRI_RADIUS_SERVER   
)
iscsi_boot_rd_attr ( ini_secondary_radius  ,
sec-radius-  server,
ISCSI_BOOT_INI_SEC_RADIUS_SERVER   
)
iscsi_boot_rd_attr ( ini_name  ,
initiator name,
ISCSI_BOOT_INI_INITIATOR_NAME   
)
MODULE_AUTHOR ( "Mike Christie <[email protected]>"  )
MODULE_DESCRIPTION ( "sysfs interface and helpers to export iSCSI boot information"  )
MODULE_LICENSE ( "GPL"  )