Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
zfcp_unit.c File Reference
#include "zfcp_def.h"
#include "zfcp_ext.h"

Go to the source code of this file.

Functions

void zfcp_unit_scsi_scan (struct zfcp_unit *unit)
 
void zfcp_unit_queue_scsi_scan (struct zfcp_port *port)
 
struct zfcp_unitzfcp_unit_find (struct zfcp_port *port, u64 fcp_lun)
 
int zfcp_unit_add (struct zfcp_port *port, u64 fcp_lun)
 
struct scsi_devicezfcp_unit_sdev (struct zfcp_unit *unit)
 
unsigned int zfcp_unit_sdev_status (struct zfcp_unit *unit)
 
int zfcp_unit_remove (struct zfcp_port *port, u64 fcp_lun)
 

Function Documentation

int zfcp_unit_add ( struct zfcp_port port,
u64  fcp_lun 
)

zfcp_unit_enqueue - enqueue unit to unit list of a port. : pointer to port where unit is added : FCP LUN of unit to be enqueued Returns: 0 success

Sets up some unit internal structures and creates sysfs entry.

Definition at line 119 of file zfcp_unit.c.

struct zfcp_unit* zfcp_unit_find ( struct zfcp_port port,
u64  fcp_lun 
)
read

zfcp_unit_find - Find and return zfcp_unit with specified FCP LUN : zfcp_port where to look for the unit : 64 Bit FCP LUN used to identify the zfcp_unit

If zfcp_unit is found, a reference is acquired that has to be released later.

Returns: Pointer to the zfcp_unit, or NULL if there is no zfcp_unit with the specified FCP LUN.

Definition at line 89 of file zfcp_unit.c.

void zfcp_unit_queue_scsi_scan ( struct zfcp_port port)

zfcp_unit_queue_scsi_scan - Register configured units on port : The zfcp_port where to register units

After opening a port, all units configured on this port have to be registered with the SCSI midlayer. This function should be called after calling fc_remote_port_add, so that the fc_rport is already ONLINE and the call to scsi_scan_target runs the same way as the call in the FC transport class.

Definition at line 51 of file zfcp_unit.c.

int zfcp_unit_remove ( struct zfcp_port port,
u64  fcp_lun 
)

zfcp_unit_remove - Remove entry from list of configured units : The port where to remove the unit from the configuration : The 64 bit LUN of the unit to remove

Returns: -EINVAL if a unit with the specified LUN does not exist, 0 on success.

Definition at line 235 of file zfcp_unit.c.

void zfcp_unit_scsi_scan ( struct zfcp_unit unit)

zfcp_unit_scsi_scan - Register LUN with SCSI midlayer : The zfcp LUN/unit to register

When the SCSI midlayer is not allowed to automatically scan and attach SCSI devices, zfcp has to register the single devices with the SCSI midlayer.

Definition at line 21 of file zfcp_unit.c.

struct scsi_device* zfcp_unit_sdev ( struct zfcp_unit unit)
read

zfcp_unit_sdev - Return SCSI device for zfcp_unit : The zfcp_unit where to get the SCSI device for

Returns: scsi_device pointer on success, NULL if there is no SCSI device for this zfcp_unit

On success, the caller also holds a reference to the SCSI device that must be released with scsi_device_put.

Definition at line 192 of file zfcp_unit.c.

unsigned int zfcp_unit_sdev_status ( struct zfcp_unit unit)

zfcp_unit_sdev_status - Return zfcp LUN status for SCSI device : The unit to lookup the SCSI device for

Returns the zfcp LUN status field of the SCSI device if the SCSI device for the zfcp_unit exists, 0 otherwise.

Definition at line 211 of file zfcp_unit.c.