You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits) [SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP [SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class [SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED [SCSI] zfcp: Update FSF error reporting [SCSI] zfcp: Improve ELS ADISC handling [SCSI] zfcp: Simplify handling of ct and els requests [SCSI] zfcp: Remove ZFCP_DID_MASK [SCSI] zfcp: Move WKA port to zfcp FC code [SCSI] zfcp: Use common code definitions for FC CT structs [SCSI] zfcp: Use common code definitions for FC ELS structs [SCSI] zfcp: Update FCP protocol related code [SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport [SCSI] zfcp: Assign scheduled work to driver queue [SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore [SCSI] zfcp: Implement module unloading [SCSI] zfcp: Merge trace code for fsf requests in one function [SCSI] zfcp: Access ports and units with container_of in sysfs code [SCSI] zfcp: Remove suspend callback [SCSI] zfcp: Remove global config_mutex [SCSI] zfcp: Replace local reference counting with common kref ...
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
What: /sys/bus/pci/drivers/qla2xxx/.../devices/*
|
||||
Date: September 2009
|
||||
Contact: QLogic Linux Driver <linux-driver@qlogic.com>
|
||||
Description: qla2xxx-udev.sh currently looks for uevent CHANGE events to
|
||||
signal a firmware-dump has been generated by the driver and is
|
||||
ready for retrieval.
|
||||
Users: qla2xxx-udev.sh. Proposed changes should be mailed to
|
||||
linux-driver@qlogic.com
|
||||
@@ -1,3 +1,65 @@
|
||||
1 Release Date : Tues. July 28, 2009 10:12:45 PST 2009 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
Bo Yang
|
||||
|
||||
2 Current Version : 00.00.04.12
|
||||
3 Older Version : 00.00.04.10
|
||||
|
||||
1. Change the AEN sys PD update from scsi_scan to
|
||||
scsi_add_device and scsi_remove_device.
|
||||
2. Takeoff the debug print-out in aen_polling routine.
|
||||
|
||||
1 Release Date : Thur. July 02, 2009 10:12:45 PST 2009 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
Bo Yang
|
||||
|
||||
2 Current Version : 00.00.04.10
|
||||
3 Older Version : 00.00.04.08
|
||||
|
||||
1. Add the 3 mins timeout during the controller initialize.
|
||||
2. Add the fix for 64bit sense date errors.
|
||||
|
||||
1 Release Date : Tues. May 05, 2009 10:12:45 PST 2009 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
Bo Yang
|
||||
|
||||
2 Current Version : 00.00.04.08
|
||||
3 Older Version : 00.00.04.06
|
||||
|
||||
1. Add the fix of pending in FW after deleted the logic drives.
|
||||
2. Add the fix of deallocating memory after get pdlist.
|
||||
|
||||
1 Release Date : Tues. March 26, 2009 10:12:45 PST 2009 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
Bo Yang
|
||||
|
||||
2 Current Version : 00.00.04.06
|
||||
3 Older Version : 00.00.04.04
|
||||
|
||||
1. Add the fix of the driver cmd empty fix of the driver cmd empty.
|
||||
2. Add the fix of the driver MSM AEN CMD cause the system slow.
|
||||
|
||||
1 Release Date : Tues. March 03, 2009 10:12:45 PST 2009 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
Bo Yang
|
||||
|
||||
2 Current Version : 00.00.04.04
|
||||
3 Older Version : 00.00.04.01
|
||||
|
||||
1. Add the Tape drive fix to the driver: If the command is for
|
||||
the tape device, set the pthru timeout to the os layer timeout value.
|
||||
|
||||
2. Add Poll_wait mechanism to Gen-2 Linux driv.
|
||||
In the aen handler, driver needs to wakeup poll handler similar to
|
||||
the way it raises SIGIO.
|
||||
|
||||
3. Add new controller new SAS2 support to the driver.
|
||||
|
||||
4. Report the unconfigured PD (system PD) to OS.
|
||||
|
||||
5. Add the IEEE SGL support to the driver
|
||||
|
||||
6. Reasign the Application cmds to SAS2 controller
|
||||
|
||||
1 Release Date : Thur.July. 24 11:41:51 PST 2008 -
|
||||
(emaild-id:megaraidlinux@lsi.com)
|
||||
|
||||
+15
@@ -4196,6 +4196,13 @@ W: http://www.pmc-sierra.com/
|
||||
S: Supported
|
||||
F: drivers/scsi/pmcraid.*
|
||||
|
||||
PMC SIERRA PM8001 DRIVER
|
||||
M: jack_wang@usish.com
|
||||
M: lindar_liu@usish.com
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
F: drivers/scsi/pm8001/
|
||||
|
||||
POSIX CLOCKS and TIMERS
|
||||
M: Thomas Gleixner <tglx@linutronix.de>
|
||||
S: Supported
|
||||
@@ -5772,6 +5779,14 @@ L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/vmxnet3/
|
||||
|
||||
VMware PVSCSI driver
|
||||
M: Alok Kataria <akataria@vmware.com>
|
||||
M: VMware PV-Drivers <pv-drivers@vmware.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/scsi/vmw_pvscsi.c
|
||||
F: drivers/scsi/vmw_pvscsi.h
|
||||
|
||||
VOLTAGE AND CURRENT REGULATOR FRAMEWORK
|
||||
M: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
M: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
|
||||
@@ -1208,6 +1208,7 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
|
||||
* ata_scsi_change_queue_depth - SCSI callback for queue depth config
|
||||
* @sdev: SCSI device to configure queue depth for
|
||||
* @queue_depth: new queue depth
|
||||
* @reason: calling context
|
||||
*
|
||||
* This is libata standard hostt->change_queue_depth callback.
|
||||
* SCSI will call into this callback when user tries to set queue
|
||||
@@ -1219,12 +1220,16 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
|
||||
* RETURNS:
|
||||
* Newly configured queue depth.
|
||||
*/
|
||||
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
|
||||
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth,
|
||||
int reason)
|
||||
{
|
||||
struct ata_port *ap = ata_shost_to_port(sdev->host);
|
||||
struct ata_device *dev;
|
||||
unsigned long flags;
|
||||
|
||||
if (reason != SCSI_QDEPTH_DEFAULT)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (queue_depth < 1 || queue_depth == sdev->queue_depth)
|
||||
return sdev->queue_depth;
|
||||
|
||||
|
||||
@@ -1975,7 +1975,7 @@ static int nv_swncq_slave_config(struct scsi_device *sdev)
|
||||
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
|
||||
|
||||
if (strncmp(model_num, "Maxtor", 6) == 0) {
|
||||
ata_scsi_change_queue_depth(sdev, 1);
|
||||
ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT);
|
||||
ata_dev_printk(dev, KERN_NOTICE,
|
||||
"Disabling SWNCQ mode (depth %x)\n", sdev->queue_depth);
|
||||
}
|
||||
|
||||
@@ -625,6 +625,7 @@ static struct iscsi_transport iscsi_iser_transport = {
|
||||
ISCSI_USERNAME | ISCSI_PASSWORD |
|
||||
ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
|
||||
ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
|
||||
ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO |
|
||||
ISCSI_PING_TMO | ISCSI_RECV_TMO |
|
||||
ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME,
|
||||
.host_param_mask = ISCSI_HOST_HWADDRESS |
|
||||
|
||||
@@ -1116,8 +1116,9 @@ static int pg_init_limit_reached(struct multipath *m, struct pgpath *pgpath)
|
||||
return limit_reached;
|
||||
}
|
||||
|
||||
static void pg_init_done(struct dm_path *path, int errors)
|
||||
static void pg_init_done(void *data, int errors)
|
||||
{
|
||||
struct dm_path *path = data;
|
||||
struct pgpath *pgpath = path_to_pgpath(path);
|
||||
struct priority_group *pg = pgpath->pg;
|
||||
struct multipath *m = pg->m;
|
||||
@@ -1183,12 +1184,11 @@ static void pg_init_done(struct dm_path *path, int errors)
|
||||
|
||||
static void activate_path(struct work_struct *work)
|
||||
{
|
||||
int ret;
|
||||
struct pgpath *pgpath =
|
||||
container_of(work, struct pgpath, activate_path);
|
||||
|
||||
ret = scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev));
|
||||
pg_init_done(&pgpath->path, ret);
|
||||
scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev),
|
||||
pg_init_done, &pgpath->path);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
#define COPYRIGHT "Copyright (c) 1999-2008 " MODULEAUTHOR
|
||||
#endif
|
||||
|
||||
#define MPT_LINUX_VERSION_COMMON "3.04.12"
|
||||
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.12"
|
||||
#define MPT_LINUX_VERSION_COMMON "3.04.13"
|
||||
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.13"
|
||||
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
|
||||
|
||||
#define show_mptmod_ver(s,ver) \
|
||||
|
||||
@@ -621,11 +621,8 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
*/
|
||||
iocnumX = khdr.iocnum & 0xFF;
|
||||
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
|
||||
(iocp == NULL)) {
|
||||
printk(KERN_DEBUG MYNAM "%s::mptctl_ioctl() @%d - ioc%d not found!\n",
|
||||
__FILE__, __LINE__, iocnumX);
|
||||
(iocp == NULL))
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!iocp->active) {
|
||||
printk(KERN_DEBUG MYNAM "%s::mptctl_ioctl() @%d - Controller disabled.\n",
|
||||
|
||||
@@ -792,11 +792,36 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
|
||||
* precedence!
|
||||
*/
|
||||
sc->result = (DID_OK << 16) | scsi_status;
|
||||
if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) {
|
||||
/* Have already saved the status and sense data
|
||||
if (!(scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID)) {
|
||||
|
||||
/*
|
||||
* For an Errata on LSI53C1030
|
||||
* When the length of request data
|
||||
* and transfer data are different
|
||||
* with result of command (READ or VERIFY),
|
||||
* DID_SOFT_ERROR is set.
|
||||
*/
|
||||
;
|
||||
} else {
|
||||
if (ioc->bus_type == SPI) {
|
||||
if (pScsiReq->CDB[0] == READ_6 ||
|
||||
pScsiReq->CDB[0] == READ_10 ||
|
||||
pScsiReq->CDB[0] == READ_12 ||
|
||||
pScsiReq->CDB[0] == READ_16 ||
|
||||
pScsiReq->CDB[0] == VERIFY ||
|
||||
pScsiReq->CDB[0] == VERIFY_16) {
|
||||
if (scsi_bufflen(sc) !=
|
||||
xfer_cnt) {
|
||||
sc->result =
|
||||
DID_SOFT_ERROR << 16;
|
||||
printk(KERN_WARNING "Errata"
|
||||
"on LSI53C1030 occurred."
|
||||
"sc->req_bufflen=0x%02x,"
|
||||
"xfer_cnt=0x%02x\n",
|
||||
scsi_bufflen(sc),
|
||||
xfer_cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (xfer_cnt < sc->underflow) {
|
||||
if (scsi_status == SAM_STAT_BUSY)
|
||||
sc->result = SAM_STAT_BUSY;
|
||||
@@ -835,7 +860,58 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
|
||||
sc->result = (DID_OK << 16) | scsi_status;
|
||||
if (scsi_state == 0) {
|
||||
;
|
||||
} else if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) {
|
||||
} else if (scsi_state &
|
||||
MPI_SCSI_STATE_AUTOSENSE_VALID) {
|
||||
|
||||
/*
|
||||
* For potential trouble on LSI53C1030.
|
||||
* (date:2007.xx.)
|
||||
* It is checked whether the length of
|
||||
* request data is equal to
|
||||
* the length of transfer and residual.
|
||||
* MEDIUM_ERROR is set by incorrect data.
|
||||
*/
|
||||
if ((ioc->bus_type == SPI) &&
|
||||
(sc->sense_buffer[2] & 0x20)) {
|
||||
u32 difftransfer;
|
||||
difftransfer =
|
||||
sc->sense_buffer[3] << 24 |
|
||||
sc->sense_buffer[4] << 16 |
|
||||
sc->sense_buffer[5] << 8 |
|
||||
sc->sense_buffer[6];
|
||||
if (((sc->sense_buffer[3] & 0x80) ==
|
||||
0x80) && (scsi_bufflen(sc)
|
||||
!= xfer_cnt)) {
|
||||
sc->sense_buffer[2] =
|
||||
MEDIUM_ERROR;
|
||||
sc->sense_buffer[12] = 0xff;
|
||||
sc->sense_buffer[13] = 0xff;
|
||||
printk(KERN_WARNING"Errata"
|
||||
"on LSI53C1030 occurred."
|
||||
"sc->req_bufflen=0x%02x,"
|
||||
"xfer_cnt=0x%02x\n" ,
|
||||
scsi_bufflen(sc),
|
||||
xfer_cnt);
|
||||
}
|
||||
if (((sc->sense_buffer[3] & 0x80)
|
||||
!= 0x80) &&
|
||||
(scsi_bufflen(sc) !=
|
||||
xfer_cnt + difftransfer)) {
|
||||
sc->sense_buffer[2] =
|
||||
MEDIUM_ERROR;
|
||||
sc->sense_buffer[12] = 0xff;
|
||||
sc->sense_buffer[13] = 0xff;
|
||||
printk(KERN_WARNING
|
||||
"Errata on LSI53C1030 occurred"
|
||||
"sc->req_bufflen=0x%02x,"
|
||||
" xfer_cnt=0x%02x,"
|
||||
"difftransfer=0x%02x\n",
|
||||
scsi_bufflen(sc),
|
||||
xfer_cnt,
|
||||
difftransfer);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If running against circa 200003dd 909 MPT f/w,
|
||||
* may get this (AUTOSENSE_VALID) for actual TASK_SET_FULL
|
||||
@@ -2275,11 +2351,12 @@ mptscsih_slave_destroy(struct scsi_device *sdev)
|
||||
* mptscsih_change_queue_depth - This function will set a devices queue depth
|
||||
* @sdev: per scsi_device pointer
|
||||
* @qdepth: requested queue depth
|
||||
* @reason: calling context
|
||||
*
|
||||
* Adding support for new 'change_queue_depth' api.
|
||||
*/
|
||||
int
|
||||
mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
|
||||
mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
|
||||
{
|
||||
MPT_SCSI_HOST *hd = shost_priv(sdev->host);
|
||||
VirtTarget *vtarget;
|
||||
@@ -2291,6 +2368,9 @@ mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
|
||||
starget = scsi_target(sdev);
|
||||
vtarget = starget->hostdata;
|
||||
|
||||
if (reason != SCSI_QDEPTH_DEFAULT)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (ioc->bus_type == SPI) {
|
||||
if (!(vtarget->tflags & MPT_TARGET_FLAGS_Q_YES))
|
||||
max_depth = 1;
|
||||
@@ -2357,7 +2437,8 @@ mptscsih_slave_configure(struct scsi_device *sdev)
|
||||
ioc->name, vtarget->negoFlags, vtarget->maxOffset,
|
||||
vtarget->minSyncFactor));
|
||||
|
||||
mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH);
|
||||
mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH,
|
||||
SCSI_QDEPTH_DEFAULT);
|
||||
dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
||||
"tagged %d, simple %d, ordered %d\n",
|
||||
ioc->name,sdev->tagged_supported, sdev->simple_tags,
|
||||
|
||||
@@ -128,7 +128,8 @@ extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_F
|
||||
extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
|
||||
extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
|
||||
extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
|
||||
extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
|
||||
extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth,
|
||||
int reason);
|
||||
extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
|
||||
extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
|
||||
extern struct device_attribute *mptscsih_host_attrs[];
|
||||
|
||||
+193
-195
File diff suppressed because it is too large
Load Diff
@@ -13,28 +13,34 @@
|
||||
|
||||
#define ZFCP_MODEL_PRIV 0x4
|
||||
|
||||
static int zfcp_ccw_suspend(struct ccw_device *cdev)
|
||||
static DEFINE_SPINLOCK(zfcp_ccw_adapter_ref_lock);
|
||||
|
||||
struct zfcp_adapter *zfcp_ccw_adapter_by_cdev(struct ccw_device *cdev)
|
||||
{
|
||||
struct zfcp_adapter *adapter = dev_get_drvdata(&cdev->dev);
|
||||
struct zfcp_adapter *adapter;
|
||||
unsigned long flags;
|
||||
|
||||
if (!adapter)
|
||||
return 0;
|
||||
spin_lock_irqsave(&zfcp_ccw_adapter_ref_lock, flags);
|
||||
adapter = dev_get_drvdata(&cdev->dev);
|
||||
if (adapter)
|
||||
kref_get(&adapter->ref);
|
||||
spin_unlock_irqrestore(&zfcp_ccw_adapter_ref_lock, flags);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
void zfcp_ccw_adapter_put(struct zfcp_adapter *adapter)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccsusp1", NULL);
|
||||
zfcp_erp_wait(adapter);
|
||||
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
|
||||
return 0;
|
||||
spin_lock_irqsave(&zfcp_ccw_adapter_ref_lock, flags);
|
||||
kref_put(&adapter->ref, zfcp_adapter_release);
|
||||
spin_unlock_irqrestore(&zfcp_ccw_adapter_ref_lock, flags);
|
||||
}
|
||||
|
||||
static int zfcp_ccw_activate(struct ccw_device *cdev)
|
||||
|
||||
{
|
||||
struct zfcp_adapter *adapter = dev_get_drvdata(&cdev->dev);
|
||||
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
if (!adapter)
|
||||
return 0;
|
||||
@@ -46,6 +52,8 @@ static int zfcp_ccw_activate(struct ccw_device *cdev)
|
||||
zfcp_erp_wait(adapter);
|
||||
flush_work(&adapter->scan_work);
|
||||
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,28 +75,28 @@ int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter)
|
||||
|
||||
/**
|
||||
* zfcp_ccw_probe - probe function of zfcp driver
|
||||
* @ccw_device: pointer to belonging ccw device
|
||||
* @cdev: pointer to belonging ccw device
|
||||
*
|
||||
* This function gets called by the common i/o layer for each FCP
|
||||
* device found on the current system. This is only a stub to make cio
|
||||
* work: To only allocate adapter resources for devices actually used,
|
||||
* the allocation is deferred to the first call to ccw_set_online.
|
||||
*/
|
||||
static int zfcp_ccw_probe(struct ccw_device *ccw_device)
|
||||
static int zfcp_ccw_probe(struct ccw_device *cdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_ccw_remove - remove function of zfcp driver
|
||||
* @ccw_device: pointer to belonging ccw device
|
||||
* @cdev: pointer to belonging ccw device
|
||||
*
|
||||
* This function gets called by the common i/o layer and removes an adapter
|
||||
* from the system. Task of this function is to get rid of all units and
|
||||
* ports that belong to this adapter. And in addition all resources of this
|
||||
* adapter will be freed too.
|
||||
*/
|
||||
static void zfcp_ccw_remove(struct ccw_device *ccw_device)
|
||||
static void zfcp_ccw_remove(struct ccw_device *cdev)
|
||||
{
|
||||
struct zfcp_adapter *adapter;
|
||||
struct zfcp_port *port, *p;
|
||||
@@ -96,49 +104,37 @@ static void zfcp_ccw_remove(struct ccw_device *ccw_device)
|
||||
LIST_HEAD(unit_remove_lh);
|
||||
LIST_HEAD(port_remove_lh);
|
||||
|
||||
ccw_device_set_offline(ccw_device);
|
||||
ccw_device_set_offline(cdev);
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
adapter = dev_get_drvdata(&ccw_device->dev);
|
||||
adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
if (!adapter)
|
||||
goto out;
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
return;
|
||||
|
||||
cancel_work_sync(&adapter->scan_work);
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
|
||||
/* this also removes the scsi devices, so call it first */
|
||||
zfcp_adapter_scsi_unregister(adapter);
|
||||
|
||||
write_lock_irq(&zfcp_data.config_lock);
|
||||
list_for_each_entry_safe(port, p, &adapter->port_list_head, list) {
|
||||
list_for_each_entry_safe(unit, u, &port->unit_list_head, list) {
|
||||
write_lock_irq(&adapter->port_list_lock);
|
||||
list_for_each_entry_safe(port, p, &adapter->port_list, list) {
|
||||
write_lock(&port->unit_list_lock);
|
||||
list_for_each_entry_safe(unit, u, &port->unit_list, list)
|
||||
list_move(&unit->list, &unit_remove_lh);
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE,
|
||||
&unit->status);
|
||||
}
|
||||
write_unlock(&port->unit_list_lock);
|
||||
list_move(&port->list, &port_remove_lh);
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status);
|
||||
}
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
|
||||
write_unlock_irq(&zfcp_data.config_lock);
|
||||
write_unlock_irq(&adapter->port_list_lock);
|
||||
zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */
|
||||
|
||||
list_for_each_entry_safe(port, p, &port_remove_lh, list) {
|
||||
list_for_each_entry_safe(unit, u, &unit_remove_lh, list)
|
||||
zfcp_unit_dequeue(unit);
|
||||
zfcp_port_dequeue(port);
|
||||
}
|
||||
wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0);
|
||||
zfcp_adapter_dequeue(adapter);
|
||||
list_for_each_entry_safe(unit, u, &unit_remove_lh, list)
|
||||
zfcp_device_unregister(&unit->sysfs_device,
|
||||
&zfcp_sysfs_unit_attrs);
|
||||
|
||||
out:
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
list_for_each_entry_safe(port, p, &port_remove_lh, list)
|
||||
zfcp_device_unregister(&port->sysfs_device,
|
||||
&zfcp_sysfs_port_attrs);
|
||||
|
||||
zfcp_adapter_unregister(adapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_ccw_set_online - set_online function of zfcp driver
|
||||
* @ccw_device: pointer to belonging ccw device
|
||||
* @cdev: pointer to belonging ccw device
|
||||
*
|
||||
* This function gets called by the common i/o layer and sets an
|
||||
* adapter into state online. The first call will allocate all
|
||||
@@ -149,23 +145,20 @@ out:
|
||||
* the SCSI stack, that the QDIO queues will be set up and that the
|
||||
* adapter will be opened.
|
||||
*/
|
||||
static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
|
||||
static int zfcp_ccw_set_online(struct ccw_device *cdev)
|
||||
{
|
||||
struct zfcp_adapter *adapter;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
adapter = dev_get_drvdata(&ccw_device->dev);
|
||||
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
if (!adapter) {
|
||||
ret = zfcp_adapter_enqueue(ccw_device);
|
||||
if (ret) {
|
||||
dev_err(&ccw_device->dev,
|
||||
adapter = zfcp_adapter_enqueue(cdev);
|
||||
|
||||
if (IS_ERR(adapter)) {
|
||||
dev_err(&cdev->dev,
|
||||
"Setting up data structures for the "
|
||||
"FCP adapter failed\n");
|
||||
goto out;
|
||||
return PTR_ERR(adapter);
|
||||
}
|
||||
adapter = dev_get_drvdata(&ccw_device->dev);
|
||||
kref_get(&adapter->ref);
|
||||
}
|
||||
|
||||
/* initialize request counter */
|
||||
@@ -177,58 +170,61 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
|
||||
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED,
|
||||
"ccsonl2", NULL);
|
||||
zfcp_erp_wait(adapter);
|
||||
out:
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
if (!ret)
|
||||
flush_work(&adapter->scan_work);
|
||||
return ret;
|
||||
|
||||
flush_work(&adapter->scan_work);
|
||||
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_ccw_set_offline - set_offline function of zfcp driver
|
||||
* @ccw_device: pointer to belonging ccw device
|
||||
* @cdev: pointer to belonging ccw device
|
||||
*
|
||||
* This function gets called by the common i/o layer and sets an adapter
|
||||
* into state offline.
|
||||
*/
|
||||
static int zfcp_ccw_set_offline(struct ccw_device *ccw_device)
|
||||
static int zfcp_ccw_set_offline(struct ccw_device *cdev)
|
||||
{
|
||||
struct zfcp_adapter *adapter;
|
||||
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
if (!adapter)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
adapter = dev_get_drvdata(&ccw_device->dev);
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1", NULL);
|
||||
zfcp_erp_wait(adapter);
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_ccw_notify - ccw notify function
|
||||
* @ccw_device: pointer to belonging ccw device
|
||||
* @cdev: pointer to belonging ccw device
|
||||
* @event: indicates if adapter was detached or attached
|
||||
*
|
||||
* This function gets called by the common i/o layer if an adapter has gone
|
||||
* or reappeared.
|
||||
*/
|
||||
static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
|
||||
static int zfcp_ccw_notify(struct ccw_device *cdev, int event)
|
||||
{
|
||||
struct zfcp_adapter *adapter = dev_get_drvdata(&ccw_device->dev);
|
||||
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
if (!adapter)
|
||||
return 1;
|
||||
|
||||
switch (event) {
|
||||
case CIO_GONE:
|
||||
dev_warn(&adapter->ccw_device->dev,
|
||||
"The FCP device has been detached\n");
|
||||
dev_warn(&cdev->dev, "The FCP device has been detached\n");
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti1", NULL);
|
||||
break;
|
||||
case CIO_NO_PATH:
|
||||
dev_warn(&adapter->ccw_device->dev,
|
||||
dev_warn(&cdev->dev,
|
||||
"The CHPID for the FCP device is offline\n");
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti2", NULL);
|
||||
break;
|
||||
case CIO_OPER:
|
||||
dev_info(&adapter->ccw_device->dev,
|
||||
"The FCP device is operational again\n");
|
||||
dev_info(&cdev->dev, "The FCP device is operational again\n");
|
||||
zfcp_erp_modify_adapter_status(adapter, "ccnoti3", NULL,
|
||||
ZFCP_STATUS_COMMON_RUNNING,
|
||||
ZFCP_SET);
|
||||
@@ -236,11 +232,13 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
|
||||
"ccnoti4", NULL);
|
||||
break;
|
||||
case CIO_BOXED:
|
||||
dev_warn(&adapter->ccw_device->dev, "The FCP device "
|
||||
"did not respond within the specified time\n");
|
||||
dev_warn(&cdev->dev, "The FCP device did not respond within "
|
||||
"the specified time\n");
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5", NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -250,18 +248,16 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
|
||||
*/
|
||||
static void zfcp_ccw_shutdown(struct ccw_device *cdev)
|
||||
{
|
||||
struct zfcp_adapter *adapter;
|
||||
struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
mutex_lock(&zfcp_data.config_mutex);
|
||||
adapter = dev_get_drvdata(&cdev->dev);
|
||||
if (!adapter)
|
||||
goto out;
|
||||
return;
|
||||
|
||||
zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1", NULL);
|
||||
zfcp_erp_wait(adapter);
|
||||
zfcp_erp_thread_kill(adapter);
|
||||
out:
|
||||
mutex_unlock(&zfcp_data.config_mutex);
|
||||
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
}
|
||||
|
||||
struct ccw_driver zfcp_ccw_driver = {
|
||||
@@ -274,18 +270,7 @@ struct ccw_driver zfcp_ccw_driver = {
|
||||
.set_offline = zfcp_ccw_set_offline,
|
||||
.notify = zfcp_ccw_notify,
|
||||
.shutdown = zfcp_ccw_shutdown,
|
||||
.freeze = zfcp_ccw_suspend,
|
||||
.freeze = zfcp_ccw_set_offline,
|
||||
.thaw = zfcp_ccw_activate,
|
||||
.restore = zfcp_ccw_activate,
|
||||
};
|
||||
|
||||
/**
|
||||
* zfcp_ccw_register - ccw register function
|
||||
*
|
||||
* Registers the driver at the common i/o layer. This function will be called
|
||||
* at module load time/system start.
|
||||
*/
|
||||
int __init zfcp_ccw_register(void)
|
||||
{
|
||||
return ccw_driver_register(&zfcp_ccw_driver);
|
||||
}
|
||||
|
||||
@@ -86,22 +86,17 @@ static int zfcp_cfdc_copy_to_user(void __user *user_buffer,
|
||||
static struct zfcp_adapter *zfcp_cfdc_get_adapter(u32 devno)
|
||||
{
|
||||
char busid[9];
|
||||
struct ccw_device *ccwdev;
|
||||
struct zfcp_adapter *adapter = NULL;
|
||||
struct ccw_device *cdev;
|
||||
struct zfcp_adapter *adapter;
|
||||
|
||||
snprintf(busid, sizeof(busid), "0.0.%04x", devno);
|
||||
ccwdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
|
||||
if (!ccwdev)
|
||||
goto out;
|
||||
cdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
|
||||
if (!cdev)
|
||||
return NULL;
|
||||
|
||||
adapter = dev_get_drvdata(&ccwdev->dev);
|
||||
if (!adapter)
|
||||
goto out_put;
|
||||
adapter = zfcp_ccw_adapter_by_cdev(cdev);
|
||||
|
||||
zfcp_adapter_get(adapter);
|
||||
out_put:
|
||||
put_device(&ccwdev->dev);
|
||||
out:
|
||||
put_device(&cdev->dev);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@@ -212,7 +207,6 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
|
||||
retval = -ENXIO;
|
||||
goto free_buffer;
|
||||
}
|
||||
zfcp_adapter_get(adapter);
|
||||
|
||||
retval = zfcp_cfdc_sg_setup(data->command, fsf_cfdc->sg,
|
||||
data_user->control_file);
|
||||
@@ -245,7 +239,7 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
|
||||
free_sg:
|
||||
zfcp_sg_free_table(fsf_cfdc->sg, ZFCP_CFDC_PAGES);
|
||||
adapter_put:
|
||||
zfcp_adapter_put(adapter);
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
free_buffer:
|
||||
kfree(data);
|
||||
no_mem_sense:
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <asm/debug.h>
|
||||
#include "zfcp_dbf.h"
|
||||
#include "zfcp_ext.h"
|
||||
#include "zfcp_fc.h"
|
||||
|
||||
static u32 dbfsize = 4;
|
||||
|
||||
@@ -177,8 +178,7 @@ void _zfcp_dbf_hba_fsf_response(const char *tag2, int level,
|
||||
|
||||
case FSF_QTCB_SEND_ELS:
|
||||
send_els = (struct zfcp_send_els *)fsf_req->data;
|
||||
response->u.els.d_id = qtcb->bottom.support.d_id;
|
||||
response->u.els.ls_code = send_els->ls_code >> 24;
|
||||
response->u.els.d_id = ntoh24(qtcb->bottom.support.d_id);
|
||||
break;
|
||||
|
||||
case FSF_QTCB_ABORT_FCP_CMND:
|
||||
@@ -348,7 +348,6 @@ static void zfcp_dbf_hba_view_response(char **p,
|
||||
|
||||
case FSF_QTCB_SEND_ELS:
|
||||
zfcp_dbf_out(p, "d_id", "0x%06x", r->u.els.d_id);
|
||||
zfcp_dbf_out(p, "ls_code", "0x%02x", r->u.els.ls_code);
|
||||
break;
|
||||
|
||||
case FSF_QTCB_ABORT_FCP_CMND:
|
||||
@@ -677,14 +676,14 @@ void zfcp_dbf_rec_action(char *id2, struct zfcp_erp_action *erp_action)
|
||||
/**
|
||||
* zfcp_dbf_san_ct_request - trace event for issued CT request
|
||||
* @fsf_req: request containing issued CT data
|
||||
* @d_id: destination id where ct request is sent to
|
||||
*/
|
||||
void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
|
||||
void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req, u32 d_id)
|
||||
{
|
||||
struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
|
||||
struct zfcp_wka_port *wka_port = ct->wka_port;
|
||||
struct zfcp_adapter *adapter = wka_port->adapter;
|
||||
struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data;
|
||||
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||
struct zfcp_dbf *dbf = adapter->dbf;
|
||||
struct ct_hdr *hdr = sg_virt(ct->req);
|
||||
struct fc_ct_hdr *hdr = sg_virt(ct->req);
|
||||
struct zfcp_dbf_san_record *r = &dbf->san_buf;
|
||||
struct zfcp_dbf_san_record_ct_request *oct = &r->u.ct_req;
|
||||
int level = 3;
|
||||
@@ -695,19 +694,18 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
|
||||
strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE);
|
||||
r->fsf_reqid = fsf_req->req_id;
|
||||
r->fsf_seqno = fsf_req->seq_no;
|
||||
r->s_id = fc_host_port_id(adapter->scsi_host);
|
||||
r->d_id = wka_port->d_id;
|
||||
oct->cmd_req_code = hdr->cmd_rsp_code;
|
||||
oct->revision = hdr->revision;
|
||||
oct->gs_type = hdr->gs_type;
|
||||
oct->gs_subtype = hdr->gs_subtype;
|
||||
oct->options = hdr->options;
|
||||
oct->max_res_size = hdr->max_res_size;
|
||||
oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr),
|
||||
oct->d_id = d_id;
|
||||
oct->cmd_req_code = hdr->ct_cmd;
|
||||
oct->revision = hdr->ct_rev;
|
||||
oct->gs_type = hdr->ct_fs_type;
|
||||
oct->gs_subtype = hdr->ct_fs_subtype;
|
||||
oct->options = hdr->ct_options;
|
||||
oct->max_res_size = hdr->ct_mr_size;
|
||||
oct->len = min((int)ct->req->length - (int)sizeof(struct fc_ct_hdr),
|
||||
ZFCP_DBF_SAN_MAX_PAYLOAD);
|
||||
debug_event(dbf->san, level, r, sizeof(*r));
|
||||
zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level,
|
||||
(void *)hdr + sizeof(struct ct_hdr), oct->len);
|
||||
(void *)hdr + sizeof(struct fc_ct_hdr), oct->len);
|
||||
spin_unlock_irqrestore(&dbf->san_lock, flags);
|
||||
}
|
||||
|
||||
@@ -717,10 +715,9 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
|
||||
*/
|
||||
void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
|
||||
struct zfcp_wka_port *wka_port = ct->wka_port;
|
||||
struct zfcp_adapter *adapter = wka_port->adapter;
|
||||
struct ct_hdr *hdr = sg_virt(ct->resp);
|
||||
struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data;
|
||||
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||
struct fc_ct_hdr *hdr = sg_virt(ct->resp);
|
||||
struct zfcp_dbf *dbf = adapter->dbf;
|
||||
struct zfcp_dbf_san_record *r = &dbf->san_buf;
|
||||
struct zfcp_dbf_san_record_ct_response *rct = &r->u.ct_resp;
|
||||
@@ -732,25 +729,23 @@ void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req)
|
||||
strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE);
|
||||
r->fsf_reqid = fsf_req->req_id;
|
||||
r->fsf_seqno = fsf_req->seq_no;
|
||||
r->s_id = wka_port->d_id;
|
||||
r->d_id = fc_host_port_id(adapter->scsi_host);
|
||||
rct->cmd_rsp_code = hdr->cmd_rsp_code;
|
||||
rct->revision = hdr->revision;
|
||||
rct->reason_code = hdr->reason_code;
|
||||
rct->expl = hdr->reason_code_expl;
|
||||
rct->vendor_unique = hdr->vendor_unique;
|
||||
rct->max_res_size = hdr->max_res_size;
|
||||
rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr),
|
||||
rct->cmd_rsp_code = hdr->ct_cmd;
|
||||
rct->revision = hdr->ct_rev;
|
||||
rct->reason_code = hdr->ct_reason;
|
||||
rct->expl = hdr->ct_explan;
|
||||
rct->vendor_unique = hdr->ct_vendor;
|
||||
rct->max_res_size = hdr->ct_mr_size;
|
||||
rct->len = min((int)ct->resp->length - (int)sizeof(struct fc_ct_hdr),
|
||||
ZFCP_DBF_SAN_MAX_PAYLOAD);
|
||||
debug_event(dbf->san, level, r, sizeof(*r));
|
||||
zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level,
|
||||
(void *)hdr + sizeof(struct ct_hdr), rct->len);
|
||||
(void *)hdr + sizeof(struct fc_ct_hdr), rct->len);
|
||||
spin_unlock_irqrestore(&dbf->san_lock, flags);
|
||||
}
|
||||
|
||||
static void zfcp_dbf_san_els(const char *tag, int level,
|
||||
struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id,
|
||||
u8 ls_code, void *buffer, int buflen)
|
||||
struct zfcp_fsf_req *fsf_req, u32 d_id,
|
||||
void *buffer, int buflen)
|
||||
{
|
||||
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||
struct zfcp_dbf *dbf = adapter->dbf;
|
||||
@@ -762,9 +757,7 @@ static void zfcp_dbf_san_els(const char *tag, int level,
|
||||
strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
|
||||
rec->fsf_reqid = fsf_req->req_id;
|
||||
rec->fsf_seqno = fsf_req->seq_no;
|
||||
rec->s_id = s_id;
|
||||
rec->d_id = d_id;
|
||||
rec->u.els.ls_code = ls_code;
|
||||
rec->u.els.d_id = d_id;
|
||||
debug_event(dbf->san, level, rec, sizeof(*rec));
|
||||
zfcp_dbf_hexdump(dbf->san, rec, sizeof(*rec), level,
|
||||
buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD));
|
||||
@@ -777,12 +770,11 @@ static void zfcp_dbf_san_els(const char *tag, int level,
|
||||
*/
|
||||
void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
|
||||
struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data;
|
||||
u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id);
|
||||
|
||||
zfcp_dbf_san_els("oels", 2, fsf_req,
|
||||
fc_host_port_id(els->adapter->scsi_host),
|
||||
els->d_id, *(u8 *) sg_virt(els->req),
|
||||
sg_virt(els->req), els->req->length);
|
||||
zfcp_dbf_san_els("oels", 2, fsf_req, d_id,
|
||||
sg_virt(els->req), els->req->length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -791,12 +783,11 @@ void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req)
|
||||
*/
|
||||
void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
|
||||
struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data;
|
||||
u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id);
|
||||
|
||||
zfcp_dbf_san_els("rels", 2, fsf_req, els->d_id,
|
||||
fc_host_port_id(els->adapter->scsi_host),
|
||||
*(u8 *)sg_virt(els->req), sg_virt(els->resp),
|
||||
els->resp->length);
|
||||
zfcp_dbf_san_els("rels", 2, fsf_req, d_id,
|
||||
sg_virt(els->resp), els->resp->length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -805,16 +796,13 @@ void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req)
|
||||
*/
|
||||
void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||
struct fsf_status_read_buffer *buf =
|
||||
(struct fsf_status_read_buffer *)fsf_req->data;
|
||||
int length = (int)buf->length -
|
||||
(int)((void *)&buf->payload - (void *)buf);
|
||||
|
||||
zfcp_dbf_san_els("iels", 1, fsf_req, buf->d_id,
|
||||
fc_host_port_id(adapter->scsi_host),
|
||||
buf->payload.data[0], (void *)buf->payload.data,
|
||||
length);
|
||||
zfcp_dbf_san_els("iels", 1, fsf_req, ntoh24(buf->d_id),
|
||||
(void *)buf->payload.data, length);
|
||||
}
|
||||
|
||||
static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
|
||||
@@ -829,11 +817,10 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
|
||||
zfcp_dbf_tag(&p, "tag", r->tag);
|
||||
zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid);
|
||||
zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno);
|
||||
zfcp_dbf_out(&p, "s_id", "0x%06x", r->s_id);
|
||||
zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id);
|
||||
|
||||
if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
|
||||
struct zfcp_dbf_san_record_ct_request *ct = &r->u.ct_req;
|
||||
zfcp_dbf_out(&p, "d_id", "0x%06x", ct->d_id);
|
||||
zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code);
|
||||
zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision);
|
||||
zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type);
|
||||
@@ -852,7 +839,7 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
|
||||
strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
|
||||
strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
|
||||
struct zfcp_dbf_san_record_els *els = &r->u.els;
|
||||
zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code);
|
||||
zfcp_dbf_out(&p, "d_id", "0x%06x", els->d_id);
|
||||
}
|
||||
return p - out_buf;
|
||||
}
|
||||
@@ -870,8 +857,9 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
|
||||
struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf;
|
||||
struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
|
||||
unsigned long flags;
|
||||
struct fcp_rsp_iu *fcp_rsp;
|
||||
char *fcp_rsp_info = NULL, *fcp_sns_info = NULL;
|
||||
struct fcp_resp_with_ext *fcp_rsp;
|
||||
struct fcp_resp_rsp_info *fcp_rsp_info = NULL;
|
||||
char *fcp_sns_info = NULL;
|
||||
int offset = 0, buflen = 0;
|
||||
|
||||
spin_lock_irqsave(&dbf->scsi_lock, flags);
|
||||
@@ -895,20 +883,22 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
|
||||
rec->scsi_allowed = scsi_cmnd->allowed;
|
||||
}
|
||||
if (fsf_req != NULL) {
|
||||
fcp_rsp = (struct fcp_rsp_iu *)
|
||||
&(fsf_req->qtcb->bottom.io.fcp_rsp);
|
||||
fcp_rsp_info = (unsigned char *) &fcp_rsp[1];
|
||||
fcp_sns_info =
|
||||
zfcp_get_fcp_sns_info_ptr(fcp_rsp);
|
||||
fcp_rsp = (struct fcp_resp_with_ext *)
|
||||
&(fsf_req->qtcb->bottom.io.fcp_rsp);
|
||||
fcp_rsp_info = (struct fcp_resp_rsp_info *)
|
||||
&fcp_rsp[1];
|
||||
fcp_sns_info = (char *) &fcp_rsp[1];
|
||||
if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL)
|
||||
fcp_sns_info += fcp_rsp->ext.fr_sns_len;
|
||||
|
||||
rec->rsp_validity = fcp_rsp->validity.value;
|
||||
rec->rsp_scsi_status = fcp_rsp->scsi_status;
|
||||
rec->rsp_resid = fcp_rsp->fcp_resid;
|
||||
if (fcp_rsp->validity.bits.fcp_rsp_len_valid)
|
||||
rec->rsp_code = *(fcp_rsp_info + 3);
|
||||
if (fcp_rsp->validity.bits.fcp_sns_len_valid) {
|
||||
buflen = min((int)fcp_rsp->fcp_sns_len,
|
||||
ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO);
|
||||
rec->rsp_validity = fcp_rsp->resp.fr_flags;
|
||||
rec->rsp_scsi_status = fcp_rsp->resp.fr_status;
|
||||
rec->rsp_resid = fcp_rsp->ext.fr_resid;
|
||||
if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL)
|
||||
rec->rsp_code = fcp_rsp_info->rsp_code;
|
||||
if (fcp_rsp->resp.fr_flags & FCP_SNS_LEN_VAL) {
|
||||
buflen = min(fcp_rsp->ext.fr_sns_len,
|
||||
(u32)ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO);
|
||||
rec->sns_info_len = buflen;
|
||||
memcpy(rec->sns_info, fcp_sns_info,
|
||||
min(buflen,
|
||||
@@ -1067,6 +1057,8 @@ err_out:
|
||||
*/
|
||||
void zfcp_dbf_adapter_unregister(struct zfcp_dbf *dbf)
|
||||
{
|
||||
if (!dbf)
|
||||
return;
|
||||
debug_unregister(dbf->scsi);
|
||||
debug_unregister(dbf->san);
|
||||
debug_unregister(dbf->hba);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#ifndef ZFCP_DBF_H
|
||||
#define ZFCP_DBF_H
|
||||
|
||||
#include <scsi/fc/fc_fcp.h>
|
||||
#include "zfcp_ext.h"
|
||||
#include "zfcp_fsf.h"
|
||||
#include "zfcp_def.h"
|
||||
@@ -122,7 +123,6 @@ struct zfcp_dbf_hba_record_response {
|
||||
} unit;
|
||||
struct {
|
||||
u32 d_id;
|
||||
u8 ls_code;
|
||||
} els;
|
||||
} u;
|
||||
} __attribute__ ((packed));
|
||||
@@ -166,6 +166,7 @@ struct zfcp_dbf_san_record_ct_request {
|
||||
u8 options;
|
||||
u16 max_res_size;
|
||||
u32 len;
|
||||
u32 d_id;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct zfcp_dbf_san_record_ct_response {
|
||||
@@ -179,16 +180,13 @@ struct zfcp_dbf_san_record_ct_response {
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct zfcp_dbf_san_record_els {
|
||||
u8 ls_code;
|
||||
u32 len;
|
||||
u32 d_id;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct zfcp_dbf_san_record {
|
||||
u8 tag[ZFCP_DBF_TAG_SIZE];
|
||||
u64 fsf_reqid;
|
||||
u32 fsf_seqno;
|
||||
u32 s_id;
|
||||
u32 d_id;
|
||||
union {
|
||||
struct zfcp_dbf_san_record_ct_request ct_req;
|
||||
struct zfcp_dbf_san_record_ct_response ct_resp;
|
||||
@@ -343,7 +341,7 @@ static inline
|
||||
void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
|
||||
struct scsi_cmnd *scsi_cmnd)
|
||||
{
|
||||
zfcp_dbf_scsi(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1,
|
||||
zfcp_dbf_scsi(flag == FCP_TMF_TGT_RESET ? "trst" : "lrst", tag, 1,
|
||||
unit->port->adapter->dbf, scsi_cmnd, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,131 +71,6 @@
|
||||
/* timeout value for "default timer" for fsf requests */
|
||||
#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ)
|
||||
|
||||
/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/
|
||||
|
||||
/* task attribute values in FCP-2 FCP_CMND IU */
|
||||
#define SIMPLE_Q 0
|
||||
#define HEAD_OF_Q 1
|
||||
#define ORDERED_Q 2
|
||||
#define ACA_Q 4
|
||||
#define UNTAGGED 5
|
||||
|
||||
/* task management flags in FCP-2 FCP_CMND IU */
|
||||
#define FCP_CLEAR_ACA 0x40
|
||||
#define FCP_TARGET_RESET 0x20
|
||||
#define FCP_LOGICAL_UNIT_RESET 0x10
|
||||
#define FCP_CLEAR_TASK_SET 0x04
|
||||
#define FCP_ABORT_TASK_SET 0x02
|
||||
|
||||
#define FCP_CDB_LENGTH 16
|
||||
|
||||
#define ZFCP_DID_MASK 0x00FFFFFF
|
||||
|
||||
/* FCP(-2) FCP_CMND IU */
|
||||
struct fcp_cmnd_iu {
|
||||
u64 fcp_lun; /* FCP logical unit number */
|
||||
u8 crn; /* command reference number */
|
||||
u8 reserved0:5; /* reserved */
|
||||
u8 task_attribute:3; /* task attribute */
|
||||
u8 task_management_flags; /* task management flags */
|
||||
u8 add_fcp_cdb_length:6; /* additional FCP_CDB length */
|
||||
u8 rddata:1; /* read data */
|
||||
u8 wddata:1; /* write data */
|
||||
u8 fcp_cdb[FCP_CDB_LENGTH];
|
||||
} __attribute__((packed));
|
||||
|
||||
/* FCP(-2) FCP_RSP IU */
|
||||
struct fcp_rsp_iu {
|
||||
u8 reserved0[10];
|
||||
union {
|
||||
struct {
|
||||
u8 reserved1:3;
|
||||
u8 fcp_conf_req:1;
|
||||
u8 fcp_resid_under:1;
|
||||
u8 fcp_resid_over:1;
|
||||
u8 fcp_sns_len_valid:1;
|
||||
u8 fcp_rsp_len_valid:1;
|
||||
} bits;
|
||||
u8 value;
|
||||
} validity;
|
||||
u8 scsi_status;
|
||||
u32 fcp_resid;
|
||||
u32 fcp_sns_len;
|
||||
u32 fcp_rsp_len;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
#define RSP_CODE_GOOD 0
|
||||
#define RSP_CODE_LENGTH_MISMATCH 1
|
||||
#define RSP_CODE_FIELD_INVALID 2
|
||||
#define RSP_CODE_RO_MISMATCH 3
|
||||
#define RSP_CODE_TASKMAN_UNSUPP 4
|
||||
#define RSP_CODE_TASKMAN_FAILED 5
|
||||
|
||||
/* see fc-fs */
|
||||
#define LS_RSCN 0x61
|
||||
#define LS_LOGO 0x05
|
||||
#define LS_PLOGI 0x03
|
||||
|
||||
struct fcp_rscn_head {
|
||||
u8 command;
|
||||
u8 page_length; /* always 0x04 */
|
||||
u16 payload_len;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct fcp_rscn_element {
|
||||
u8 reserved:2;
|
||||
u8 event_qual:4;
|
||||
u8 addr_format:2;
|
||||
u32 nport_did:24;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* see fc-ph */
|
||||
struct fcp_logo {
|
||||
u32 command;
|
||||
u32 nport_did;
|
||||
u64 nport_wwpn;
|
||||
} __attribute__((packed));
|
||||
|
||||
/*
|
||||
* FC-FS stuff
|
||||
*/
|
||||
#define R_A_TOV 10 /* seconds */
|
||||
|
||||
#define ZFCP_LS_RLS 0x0f
|
||||
#define ZFCP_LS_ADISC 0x52
|
||||
#define ZFCP_LS_RPS 0x56
|
||||
#define ZFCP_LS_RSCN 0x61
|
||||
#define ZFCP_LS_RNID 0x78
|
||||
|
||||
struct zfcp_ls_adisc {
|
||||
u8 code;
|
||||
u8 field[3];
|
||||
u32 hard_nport_id;
|
||||
u64 wwpn;
|
||||
u64 wwnn;
|
||||
u32 nport_id;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/*
|
||||
* FC-GS-2 stuff
|
||||
*/
|
||||
#define ZFCP_CT_REVISION 0x01
|
||||
#define ZFCP_CT_DIRECTORY_SERVICE 0xFC
|
||||
#define ZFCP_CT_NAME_SERVER 0x02
|
||||
#define ZFCP_CT_SYNCHRONOUS 0x00
|
||||
#define ZFCP_CT_SCSI_FCP 0x08
|
||||
#define ZFCP_CT_UNABLE_TO_PERFORM_CMD 0x09
|
||||
#define ZFCP_CT_GID_PN 0x0121
|
||||
#define ZFCP_CT_GPN_FT 0x0172
|
||||
#define ZFCP_CT_ACCEPT 0x8002
|
||||
#define ZFCP_CT_REJECT 0x8001
|
||||
|
||||
/*
|
||||
* FC-GS-4 stuff
|
||||
*/
|
||||
#define ZFCP_CT_TIMEOUT (3 * R_A_TOV)
|
||||
|
||||
/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
|
||||
|
||||
/*
|
||||
@@ -205,7 +80,6 @@ struct zfcp_ls_adisc {
|
||||
#define ZFCP_COMMON_FLAGS 0xfff00000
|
||||
|
||||
/* common status bits */
|
||||
#define ZFCP_STATUS_COMMON_REMOVE 0x80000000
|
||||
#define ZFCP_STATUS_COMMON_RUNNING 0x40000000
|
||||
#define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000
|
||||
#define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000
|
||||
@@ -222,21 +96,10 @@ struct zfcp_ls_adisc {
|
||||
#define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100
|
||||
#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
|
||||
|
||||
/* FC-PH/FC-GS well-known address identifiers for generic services */
|
||||
#define ZFCP_DID_WKA 0xFFFFF0
|
||||
|
||||
/* remote port status */
|
||||
#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001
|
||||
#define ZFCP_STATUS_PORT_LINK_TEST 0x00000002
|
||||
|
||||
/* well known address (WKA) port status*/
|
||||
enum zfcp_wka_status {
|
||||
ZFCP_WKA_PORT_OFFLINE,
|
||||
ZFCP_WKA_PORT_CLOSING,
|
||||
ZFCP_WKA_PORT_OPENING,
|
||||
ZFCP_WKA_PORT_ONLINE,
|
||||
};
|
||||
|
||||
/* logical unit status */
|
||||
#define ZFCP_STATUS_UNIT_SHARED 0x00000004
|
||||
#define ZFCP_STATUS_UNIT_READONLY 0x00000008
|
||||
@@ -247,10 +110,7 @@ enum zfcp_wka_status {
|
||||
#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
|
||||
#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040
|
||||
#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080
|
||||
#define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100
|
||||
#define ZFCP_STATUS_FSFREQ_TMFUNCFAILED 0x00000200
|
||||
#define ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP 0x00000400
|
||||
#define ZFCP_STATUS_FSFREQ_RETRY 0x00000800
|
||||
#define ZFCP_STATUS_FSFREQ_DISMISSED 0x00001000
|
||||
|
||||
/************************* STRUCTURE DEFINITIONS *****************************/
|
||||
@@ -265,125 +125,10 @@ struct zfcp_adapter_mempool {
|
||||
mempool_t *scsi_abort;
|
||||
mempool_t *status_read_req;
|
||||
mempool_t *status_read_data;
|
||||
mempool_t *gid_pn_data;
|
||||
mempool_t *gid_pn;
|
||||
mempool_t *qtcb_pool;
|
||||
};
|
||||
|
||||
/*
|
||||
* header for CT_IU
|
||||
*/
|
||||
struct ct_hdr {
|
||||
u8 revision; // 0x01
|
||||
u8 in_id[3]; // 0x00
|
||||
u8 gs_type; // 0xFC Directory Service
|
||||
u8 gs_subtype; // 0x02 Name Server
|
||||
u8 options; // 0x00 single bidirectional exchange
|
||||
u8 reserved0;
|
||||
u16 cmd_rsp_code; // 0x0121 GID_PN, or 0x0100 GA_NXT
|
||||
u16 max_res_size; // <= (4096 - 16) / 4
|
||||
u8 reserved1;
|
||||
u8 reason_code;
|
||||
u8 reason_code_expl;
|
||||
u8 vendor_unique;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* nameserver request CT_IU -- for requests where
|
||||
* a port name is required */
|
||||
struct ct_iu_gid_pn_req {
|
||||
struct ct_hdr header;
|
||||
u64 wwpn;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* FS_ACC IU and data unit for GID_PN nameserver request */
|
||||
struct ct_iu_gid_pn_resp {
|
||||
struct ct_hdr header;
|
||||
u32 d_id;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct ct_iu_gpn_ft_req {
|
||||
struct ct_hdr header;
|
||||
u8 flags;
|
||||
u8 domain_id_scope;
|
||||
u8 area_id_scope;
|
||||
u8 fc4_type;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
/**
|
||||
* struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct
|
||||
* @wka_port: port where the request is sent to
|
||||
* @req: scatter-gather list for request
|
||||
* @resp: scatter-gather list for response
|
||||
* @handler: handler function (called for response to the request)
|
||||
* @handler_data: data passed to handler function
|
||||
* @completion: completion for synchronization purposes
|
||||
* @status: used to pass error status to calling function
|
||||
*/
|
||||
struct zfcp_send_ct {
|
||||
struct zfcp_wka_port *wka_port;
|
||||
struct scatterlist *req;
|
||||
struct scatterlist *resp;
|
||||
void (*handler)(unsigned long);
|
||||
unsigned long handler_data;
|
||||
struct completion *completion;
|
||||
int status;
|
||||
};
|
||||
|
||||
/* used for name server requests in error recovery */
|
||||
struct zfcp_gid_pn_data {
|
||||
struct zfcp_send_ct ct;
|
||||
struct scatterlist req;
|
||||
struct scatterlist resp;
|
||||
struct ct_iu_gid_pn_req ct_iu_req;
|
||||
struct ct_iu_gid_pn_resp ct_iu_resp;
|
||||
struct zfcp_port *port;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
|
||||
* @adapter: adapter where request is sent from
|
||||
* @port: port where ELS is destinated (port reference count has to be increased)
|
||||
* @d_id: destiniation id of port where request is sent to
|
||||
* @req: scatter-gather list for request
|
||||
* @resp: scatter-gather list for response
|
||||
* @handler: handler function (called for response to the request)
|
||||
* @handler_data: data passed to handler function
|
||||
* @completion: completion for synchronization purposes
|
||||
* @ls_code: hex code of ELS command
|
||||
* @status: used to pass error status to calling function
|
||||
*/
|
||||
struct zfcp_send_els {
|
||||
struct zfcp_adapter *adapter;
|
||||
struct zfcp_port *port;
|
||||
u32 d_id;
|
||||
struct scatterlist *req;
|
||||
struct scatterlist *resp;
|
||||
void (*handler)(unsigned long);
|
||||
unsigned long handler_data;
|
||||
struct completion *completion;
|
||||
int ls_code;
|
||||
int status;
|
||||
};
|
||||
|
||||
struct zfcp_wka_port {
|
||||
struct zfcp_adapter *adapter;
|
||||
wait_queue_head_t completion_wq;
|
||||
enum zfcp_wka_status status;
|
||||
atomic_t refcount;
|
||||
u32 d_id;
|
||||
u32 handle;
|
||||
struct mutex mutex;
|
||||
struct delayed_work work;
|
||||
};
|
||||
|
||||
struct zfcp_wka_ports {
|
||||
struct zfcp_wka_port ms; /* management service */
|
||||
struct zfcp_wka_port ts; /* time service */
|
||||
struct zfcp_wka_port ds; /* directory service */
|
||||
struct zfcp_wka_port as; /* alias service */
|
||||
struct zfcp_wka_port ks; /* key distribution service */
|
||||
};
|
||||
|
||||
struct zfcp_qdio_queue {
|
||||
struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q];
|
||||
u8 first; /* index of next free bfr in queue */
|
||||
@@ -446,9 +191,7 @@ struct zfcp_qdio {
|
||||
};
|
||||
|
||||
struct zfcp_adapter {
|
||||
atomic_t refcount; /* reference count */
|
||||
wait_queue_head_t remove_wq; /* can be used to wait for
|
||||
refcount drop to zero */
|
||||
struct kref ref;
|
||||
u64 peer_wwnn; /* P2P peer WWNN */
|
||||
u64 peer_wwpn; /* P2P peer WWPN */
|
||||
u32 peer_d_id; /* P2P peer D_ID */
|
||||
@@ -461,7 +204,8 @@ struct zfcp_adapter {
|
||||
u32 hardware_version; /* of FCP channel */
|
||||
u16 timer_ticks; /* time int for a tick */
|
||||
struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
|
||||
struct list_head port_list_head; /* remote port list */
|
||||
struct list_head port_list; /* remote port list */
|
||||
rwlock_t port_list_lock; /* port list lock */
|
||||
unsigned long req_no; /* unique FSF req number */
|
||||
struct list_head *req_list; /* list of pending reqs */
|
||||
spinlock_t req_list_lock; /* request list lock */
|
||||
@@ -485,7 +229,7 @@ struct zfcp_adapter {
|
||||
u32 erp_low_mem_count; /* nr of erp actions waiting
|
||||
for memory */
|
||||
struct task_struct *erp_thread;
|
||||
struct zfcp_wka_ports *gs; /* generic services */
|
||||
struct zfcp_fc_wka_ports *gs; /* generic services */
|
||||
struct zfcp_dbf *dbf; /* debug traces */
|
||||
struct zfcp_adapter_mempool pool; /* Adapter memory pools */
|
||||
struct fc_host_statistics *fc_stats;
|
||||
@@ -500,11 +244,9 @@ struct zfcp_port {
|
||||
struct device sysfs_device; /* sysfs device */
|
||||
struct fc_rport *rport; /* rport of fc transport class */
|
||||
struct list_head list; /* list of remote ports */
|
||||
atomic_t refcount; /* reference count */
|
||||
wait_queue_head_t remove_wq; /* can be used to wait for
|
||||
refcount drop to zero */
|
||||
struct zfcp_adapter *adapter; /* adapter used to access port */
|
||||
struct list_head unit_list_head; /* head of logical unit list */
|
||||
struct list_head unit_list; /* head of logical unit list */
|
||||
rwlock_t unit_list_lock; /* unit list lock */
|
||||
atomic_t status; /* status of this remote port */
|
||||
u64 wwnn; /* WWNN if known */
|
||||
u64 wwpn; /* WWPN */
|
||||
@@ -523,9 +265,6 @@ struct zfcp_port {
|
||||
struct zfcp_unit {
|
||||
struct device sysfs_device; /* sysfs device */
|
||||
struct list_head list; /* list of logical units */
|
||||
atomic_t refcount; /* reference count */
|
||||
wait_queue_head_t remove_wq; /* can be used to wait for
|
||||
refcount drop to zero */
|
||||
struct zfcp_port *port; /* remote port of unit */
|
||||
atomic_t status; /* status of this logical unit */
|
||||
u64 fcp_lun; /* own FCP_LUN */
|
||||
@@ -601,14 +340,11 @@ struct zfcp_fsf_req {
|
||||
struct zfcp_data {
|
||||
struct scsi_host_template scsi_host_template;
|
||||
struct scsi_transport_template *scsi_transport_template;
|
||||
rwlock_t config_lock; /* serialises changes
|
||||
to adapter/port/unit
|
||||
lists */
|
||||
struct mutex config_mutex;
|
||||
struct kmem_cache *gpn_ft_cache;
|
||||
struct kmem_cache *qtcb_cache;
|
||||
struct kmem_cache *sr_buffer_cache;
|
||||
struct kmem_cache *gid_pn_cache;
|
||||
struct kmem_cache *adisc_cache;
|
||||
};
|
||||
|
||||
/********************** ZFCP SPECIFIC DEFINES ********************************/
|
||||
@@ -657,47 +393,4 @@ zfcp_reqlist_find_safe(struct zfcp_adapter *adapter, struct zfcp_fsf_req *req)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* functions needed for reference/usage counting
|
||||
*/
|
||||
|
||||
static inline void
|
||||
zfcp_unit_get(struct zfcp_unit *unit)
|
||||
{
|
||||
atomic_inc(&unit->refcount);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfcp_unit_put(struct zfcp_unit *unit)
|
||||
{
|
||||
if (atomic_dec_return(&unit->refcount) == 0)
|
||||
wake_up(&unit->remove_wq);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfcp_port_get(struct zfcp_port *port)
|
||||
{
|
||||
atomic_inc(&port->refcount);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfcp_port_put(struct zfcp_port *port)
|
||||
{
|
||||
if (atomic_dec_return(&port->refcount) == 0)
|
||||
wake_up(&port->remove_wq);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfcp_adapter_get(struct zfcp_adapter *adapter)
|
||||
{
|
||||
atomic_inc(&adapter->refcount);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zfcp_adapter_put(struct zfcp_adapter *adapter)
|
||||
{
|
||||
if (atomic_dec_return(&adapter->refcount) == 0)
|
||||
wake_up(&adapter->remove_wq);
|
||||
}
|
||||
|
||||
#endif /* ZFCP_DEF_H */
|
||||
|
||||
@@ -99,9 +99,12 @@ static void zfcp_erp_action_dismiss_port(struct zfcp_port *port)
|
||||
|
||||
if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_INUSE)
|
||||
zfcp_erp_action_dismiss(&port->erp_action);
|
||||
else
|
||||
list_for_each_entry(unit, &port->unit_list_head, list)
|
||||
zfcp_erp_action_dismiss_unit(unit);
|
||||
else {
|
||||
read_lock(&port->unit_list_lock);
|
||||
list_for_each_entry(unit, &port->unit_list, list)
|
||||
zfcp_erp_action_dismiss_unit(unit);
|
||||
read_unlock(&port->unit_list_lock);
|
||||
}
|
||||
}
|
||||
|
||||
static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
|
||||
@@ -110,9 +113,12 @@ static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
|
||||
|
||||
if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_INUSE)
|
||||
zfcp_erp_action_dismiss(&adapter->erp_action);
|
||||
else
|
||||
list_for_each_entry(port, &adapter->port_list_head, list)
|
||||
else {
|
||||
read_lock(&adapter->port_list_lock);
|
||||
list_for_each_entry(port, &adapter->port_list, list)
|
||||
zfcp_erp_action_dismiss_port(port);
|
||||
read_unlock(&adapter->port_list_lock);
|
||||
}
|
||||
}
|
||||
|
||||
static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
|
||||
@@ -168,7 +174,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need,
|
||||
|
||||
switch (need) {
|
||||
case ZFCP_ERP_ACTION_REOPEN_UNIT:
|
||||
zfcp_unit_get(unit);
|
||||
if (!get_device(&unit->sysfs_device))
|
||||
return NULL;
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status);
|
||||
erp_action = &unit->erp_action;
|
||||
if (!(atomic_read(&unit->status) & ZFCP_STATUS_COMMON_RUNNING))
|
||||
@@ -177,7 +184,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need,
|
||||
|
||||
case ZFCP_ERP_ACTION_REOPEN_PORT:
|
||||
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
|
||||
zfcp_port_get(port);
|
||||
if (!get_device(&port->sysfs_device))
|
||||
return NULL;
|
||||
zfcp_erp_action_dismiss_port(port);
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status);
|
||||
erp_action = &port->erp_action;
|
||||
@@ -186,7 +194,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need,
|
||||
break;
|
||||
|
||||
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
|
||||
zfcp_adapter_get(adapter);
|
||||
kref_get(&adapter->ref);
|
||||
zfcp_erp_action_dismiss_adapter(adapter);
|
||||
atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status);
|
||||
erp_action = &adapter->erp_action;
|
||||
@@ -264,11 +272,16 @@ void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear,
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
_zfcp_erp_adapter_reopen(adapter, clear, id, ref);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
zfcp_erp_adapter_block(adapter, clear);
|
||||
zfcp_scsi_schedule_rports_block(adapter);
|
||||
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
||||
zfcp_erp_adapter_failed(adapter, "erareo1", NULL);
|
||||
else
|
||||
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, adapter,
|
||||
NULL, NULL, id, ref);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,11 +358,9 @@ void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, char *id,
|
||||
unsigned long flags;
|
||||
struct zfcp_adapter *adapter = port->adapter;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
_zfcp_erp_port_forced_reopen(port, clear, id, ref);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
}
|
||||
|
||||
static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id,
|
||||
@@ -377,15 +388,13 @@ static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id,
|
||||
*/
|
||||
int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id, void *ref)
|
||||
{
|
||||
unsigned long flags;
|
||||
int retval;
|
||||
unsigned long flags;
|
||||
struct zfcp_adapter *adapter = port->adapter;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
retval = _zfcp_erp_port_reopen(port, clear, id, ref);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -424,11 +433,9 @@ void zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id,
|
||||
struct zfcp_port *port = unit->port;
|
||||
struct zfcp_adapter *adapter = port->adapter;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
_zfcp_erp_unit_reopen(unit, clear, id, ref);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
}
|
||||
|
||||
static int status_change_set(unsigned long mask, atomic_t *status)
|
||||
@@ -540,8 +547,10 @@ static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter,
|
||||
{
|
||||
struct zfcp_port *port;
|
||||
|
||||
list_for_each_entry(port, &adapter->port_list_head, list)
|
||||
read_lock(&adapter->port_list_lock);
|
||||
list_for_each_entry(port, &adapter->port_list, list)
|
||||
_zfcp_erp_port_reopen(port, clear, id, ref);
|
||||
read_unlock(&adapter->port_list_lock);
|
||||
}
|
||||
|
||||
static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear,
|
||||
@@ -549,8 +558,10 @@ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear,
|
||||
{
|
||||
struct zfcp_unit *unit;
|
||||
|
||||
list_for_each_entry(unit, &port->unit_list_head, list)
|
||||
read_lock(&port->unit_list_lock);
|
||||
list_for_each_entry(unit, &port->unit_list, list)
|
||||
_zfcp_erp_unit_reopen(unit, clear, id, ref);
|
||||
read_unlock(&port->unit_list_lock);
|
||||
}
|
||||
|
||||
static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act)
|
||||
@@ -590,16 +601,14 @@ static void zfcp_erp_wakeup(struct zfcp_adapter *adapter)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
read_lock(&adapter->erp_lock);
|
||||
read_lock_irqsave(&adapter->erp_lock, flags);
|
||||
if (list_empty(&adapter->erp_ready_head) &&
|
||||
list_empty(&adapter->erp_running_head)) {
|
||||
atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING,
|
||||
&adapter->status);
|
||||
wake_up(&adapter->erp_done_wqh);
|
||||
}
|
||||
read_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
read_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
}
|
||||
|
||||
static int zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *act)
|
||||
@@ -1170,28 +1179,28 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
|
||||
switch (act->action) {
|
||||
case ZFCP_ERP_ACTION_REOPEN_UNIT:
|
||||
if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) {
|
||||
zfcp_unit_get(unit);
|
||||
get_device(&unit->sysfs_device);
|
||||
if (scsi_queue_work(unit->port->adapter->scsi_host,
|
||||
&unit->scsi_work) <= 0)
|
||||
zfcp_unit_put(unit);
|
||||
put_device(&unit->sysfs_device);
|
||||
}
|
||||
zfcp_unit_put(unit);
|
||||
put_device(&unit->sysfs_device);
|
||||
break;
|
||||
|
||||
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
|
||||
case ZFCP_ERP_ACTION_REOPEN_PORT:
|
||||
if (result == ZFCP_ERP_SUCCEEDED)
|
||||
zfcp_scsi_schedule_rport_register(port);
|
||||
zfcp_port_put(port);
|
||||
put_device(&port->sysfs_device);
|
||||
break;
|
||||
|
||||
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
|
||||
if (result == ZFCP_ERP_SUCCEEDED) {
|
||||
register_service_level(&adapter->service_level);
|
||||
schedule_work(&adapter->scan_work);
|
||||
queue_work(adapter->work_queue, &adapter->scan_work);
|
||||
} else
|
||||
unregister_service_level(&adapter->service_level);
|
||||
zfcp_adapter_put(adapter);
|
||||
kref_put(&adapter->ref, zfcp_adapter_release);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1214,12 +1223,12 @@ static int zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action)
|
||||
static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
|
||||
{
|
||||
int retval;
|
||||
struct zfcp_adapter *adapter = erp_action->adapter;
|
||||
unsigned long flags;
|
||||
struct zfcp_adapter *adapter = erp_action->adapter;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
kref_get(&adapter->ref);
|
||||
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
zfcp_erp_strategy_check_fsfreq(erp_action);
|
||||
|
||||
if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) {
|
||||
@@ -1231,11 +1240,9 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
|
||||
zfcp_erp_action_to_running(erp_action);
|
||||
|
||||
/* no lock to allow for blocking operations */
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
retval = zfcp_erp_strategy_do_action(erp_action);
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
write_lock(&adapter->erp_lock);
|
||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||
|
||||
if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED)
|
||||
retval = ZFCP_ERP_CONTINUES;
|
||||
@@ -1273,12 +1280,12 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
|
||||
zfcp_erp_strategy_followup_failed(erp_action);
|
||||
|
||||
unlock:
|
||||
write_unlock(&adapter->erp_lock);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||
|
||||
if (retval != ZFCP_ERP_CONTINUES)
|
||||
zfcp_erp_action_cleanup(erp_action, retval);
|
||||
|
||||
kref_put(&adapter->ref, zfcp_adapter_release);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1415,6 +1422,7 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id,
|
||||
void *ref, u32 mask, int set_or_clear)
|
||||
{
|
||||
struct zfcp_port *port;
|
||||
unsigned long flags;
|
||||
u32 common_mask = mask & ZFCP_COMMON_FLAGS;
|
||||
|
||||
if (set_or_clear == ZFCP_SET) {
|
||||
@@ -1429,10 +1437,13 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id,
|
||||
atomic_set(&adapter->erp_counter, 0);
|
||||
}
|
||||
|
||||
if (common_mask)
|
||||
list_for_each_entry(port, &adapter->port_list_head, list)
|
||||
if (common_mask) {
|
||||
read_lock_irqsave(&adapter->port_list_lock, flags);
|
||||
list_for_each_entry(port, &adapter->port_list, list)
|
||||
zfcp_erp_modify_port_status(port, id, ref, common_mask,
|
||||
set_or_clear);
|
||||
read_unlock_irqrestore(&adapter->port_list_lock, flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1449,6 +1460,7 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref,
|
||||
u32 mask, int set_or_clear)
|
||||
{
|
||||
struct zfcp_unit *unit;
|
||||
unsigned long flags;
|
||||
u32 common_mask = mask & ZFCP_COMMON_FLAGS;
|
||||
|
||||
if (set_or_clear == ZFCP_SET) {
|
||||
@@ -1463,10 +1475,13 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref,
|
||||
atomic_set(&port->erp_counter, 0);
|
||||
}
|
||||
|
||||
if (common_mask)
|
||||
list_for_each_entry(unit, &port->unit_list_head, list)
|
||||
if (common_mask) {
|
||||
read_lock_irqsave(&port->unit_list_lock, flags);
|
||||
list_for_each_entry(unit, &port->unit_list, list)
|
||||
zfcp_erp_modify_unit_status(unit, id, ref, common_mask,
|
||||
set_or_clear);
|
||||
read_unlock_irqrestore(&port->unit_list_lock, flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1502,12 +1517,8 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, char *id, void *ref,
|
||||
*/
|
||||
void zfcp_erp_port_boxed(struct zfcp_port *port, char *id, void *ref)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
zfcp_erp_modify_port_status(port, id, ref,
|
||||
ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref);
|
||||
}
|
||||
|
||||
@@ -1535,13 +1546,9 @@ void zfcp_erp_unit_boxed(struct zfcp_unit *unit, char *id, void *ref)
|
||||
*/
|
||||
void zfcp_erp_port_access_denied(struct zfcp_port *port, char *id, void *ref)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
zfcp_erp_modify_port_status(port, id, ref,
|
||||
ZFCP_STATUS_COMMON_ERP_FAILED |
|
||||
ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1574,12 +1581,15 @@ static void zfcp_erp_port_access_changed(struct zfcp_port *port, char *id,
|
||||
void *ref)
|
||||
{
|
||||
struct zfcp_unit *unit;
|
||||
unsigned long flags;
|
||||
int status = atomic_read(&port->status);
|
||||
|
||||
if (!(status & (ZFCP_STATUS_COMMON_ACCESS_DENIED |
|
||||
ZFCP_STATUS_COMMON_ACCESS_BOXED))) {
|
||||
list_for_each_entry(unit, &port->unit_list_head, list)
|
||||
read_lock_irqsave(&port->unit_list_lock, flags);
|
||||
list_for_each_entry(unit, &port->unit_list, list)
|
||||
zfcp_erp_unit_access_changed(unit, id, ref);
|
||||
read_unlock_irqrestore(&port->unit_list_lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1595,14 +1605,14 @@ static void zfcp_erp_port_access_changed(struct zfcp_port *port, char *id,
|
||||
void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, char *id,
|
||||
void *ref)
|
||||
{
|
||||
struct zfcp_port *port;
|
||||
unsigned long flags;
|
||||
struct zfcp_port *port;
|
||||
|
||||
if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
|
||||
return;
|
||||
|
||||
read_lock_irqsave(&zfcp_data.config_lock, flags);
|
||||
list_for_each_entry(port, &adapter->port_list_head, list)
|
||||
read_lock_irqsave(&adapter->port_list_lock, flags);
|
||||
list_for_each_entry(port, &adapter->port_list, list)
|
||||
zfcp_erp_port_access_changed(port, id, ref);
|
||||
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
|
||||
read_unlock_irqrestore(&adapter->port_list_lock, flags);
|
||||
}
|
||||
|
||||
@@ -9,26 +9,31 @@
|
||||
#ifndef ZFCP_EXT_H
|
||||
#define ZFCP_EXT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <scsi/fc/fc_els.h>
|
||||
#include "zfcp_def.h"
|
||||
#include "zfcp_fc.h"
|
||||
|
||||
/* zfcp_aux.c */
|
||||
extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, u64);
|
||||
extern struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *, u64);
|
||||
extern int zfcp_adapter_enqueue(struct ccw_device *);
|
||||
extern void zfcp_adapter_dequeue(struct zfcp_adapter *);
|
||||
extern struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *);
|
||||
extern struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *, u64, u32,
|
||||
u32);
|
||||
extern void zfcp_port_dequeue(struct zfcp_port *);
|
||||
extern struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *, u64);
|
||||
extern void zfcp_unit_dequeue(struct zfcp_unit *);
|
||||
extern int zfcp_reqlist_isempty(struct zfcp_adapter *);
|
||||
extern void zfcp_sg_free_table(struct scatterlist *, int);
|
||||
extern int zfcp_sg_setup_table(struct scatterlist *, int);
|
||||
extern void zfcp_device_unregister(struct device *,
|
||||
const struct attribute_group *);
|
||||
extern void zfcp_adapter_release(struct kref *);
|
||||
extern void zfcp_adapter_unregister(struct zfcp_adapter *);
|
||||
|
||||
/* zfcp_ccw.c */
|
||||
extern int zfcp_ccw_register(void);
|
||||
extern int zfcp_ccw_priv_sch(struct zfcp_adapter *);
|
||||
extern struct ccw_driver zfcp_ccw_driver;
|
||||
extern struct zfcp_adapter *zfcp_ccw_adapter_by_cdev(struct ccw_device *);
|
||||
extern void zfcp_ccw_adapter_put(struct zfcp_adapter *);
|
||||
|
||||
/* zfcp_cfdc.c */
|
||||
extern struct miscdevice zfcp_cfdc_misc;
|
||||
@@ -51,7 +56,7 @@ extern void _zfcp_dbf_hba_fsf_unsol(const char *, int level, struct zfcp_dbf *,
|
||||
struct fsf_status_read_buffer *);
|
||||
extern void zfcp_dbf_hba_qdio(struct zfcp_dbf *, unsigned int, int, int);
|
||||
extern void zfcp_dbf_hba_berr(struct zfcp_dbf *, struct zfcp_fsf_req *);
|
||||
extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *);
|
||||
extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *, u32);
|
||||
extern void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *);
|
||||
extern void zfcp_dbf_san_els_request(struct zfcp_fsf_req *);
|
||||
extern void zfcp_dbf_san_els_response(struct zfcp_fsf_req *);
|
||||
@@ -92,24 +97,22 @@ extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, char *,
|
||||
extern void zfcp_erp_timeout_handler(unsigned long);
|
||||
|
||||
/* zfcp_fc.c */
|
||||
extern int zfcp_fc_scan_ports(struct zfcp_adapter *);
|
||||
extern void _zfcp_fc_scan_ports_later(struct work_struct *);
|
||||
extern void zfcp_fc_scan_ports(struct work_struct *);
|
||||
extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *);
|
||||
extern void zfcp_fc_port_did_lookup(struct work_struct *);
|
||||
extern void zfcp_fc_trigger_did_lookup(struct zfcp_port *);
|
||||
extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
|
||||
extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fc_els_flogi *);
|
||||
extern void zfcp_fc_test_link(struct zfcp_port *);
|
||||
extern void zfcp_fc_link_test_work(struct work_struct *);
|
||||
extern void zfcp_fc_wka_ports_force_offline(struct zfcp_wka_ports *);
|
||||
extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *);
|
||||
extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
|
||||
extern void zfcp_fc_gs_destroy(struct zfcp_adapter *);
|
||||
extern int zfcp_fc_execute_els_fc_job(struct fc_bsg_job *);
|
||||
extern int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *);
|
||||
extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *);
|
||||
|
||||
/* zfcp_fsf.c */
|
||||
extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
|
||||
extern int zfcp_fsf_open_wka_port(struct zfcp_wka_port *);
|
||||
extern int zfcp_fsf_close_wka_port(struct zfcp_wka_port *);
|
||||
extern int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *);
|
||||
extern int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *);
|
||||
extern int zfcp_fsf_close_port(struct zfcp_erp_action *);
|
||||
extern int zfcp_fsf_close_physical_port(struct zfcp_erp_action *);
|
||||
extern int zfcp_fsf_open_unit(struct zfcp_erp_action *);
|
||||
@@ -125,8 +128,10 @@ extern struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *,
|
||||
extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
|
||||
extern int zfcp_fsf_status_read(struct zfcp_qdio *);
|
||||
extern int zfcp_status_read_refill(struct zfcp_adapter *adapter);
|
||||
extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *);
|
||||
extern int zfcp_fsf_send_els(struct zfcp_send_els *);
|
||||
extern int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *, struct zfcp_fsf_ct_els *,
|
||||
mempool_t *);
|
||||
extern int zfcp_fsf_send_els(struct zfcp_adapter *, u32,
|
||||
struct zfcp_fsf_ct_els *);
|
||||
extern int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *,
|
||||
struct scsi_cmnd *);
|
||||
extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
|
||||
@@ -153,7 +158,6 @@ extern void zfcp_qdio_close(struct zfcp_qdio *);
|
||||
extern struct zfcp_data zfcp_data;
|
||||
extern int zfcp_adapter_scsi_register(struct zfcp_adapter *);
|
||||
extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *);
|
||||
extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *);
|
||||
extern struct fc_function_template zfcp_transport_functions;
|
||||
extern void zfcp_scsi_rport_work(struct work_struct *);
|
||||
extern void zfcp_scsi_schedule_rport_register(struct zfcp_port *);
|
||||
|
||||
+296
-397
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user