Skip to content

Commit

Permalink
Merge by hand (conflicts in sd.c)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bottomley committed Sep 6, 2005
2 parents 3173d8c + fe1b2d5 commit 17fa53d
Show file tree
Hide file tree
Showing 49 changed files with 2,482 additions and 755 deletions.
41 changes: 0 additions & 41 deletions Documentation/scsi/scsi_mid_low_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,11 @@ Summary:
scsi_activate_tcq - turn on tag command queueing
scsi_add_device - creates new scsi device (lu) instance
scsi_add_host - perform sysfs registration and SCSI bus scan.
scsi_add_timer - (re-)start timer on a SCSI command.
scsi_adjust_queue_depth - change the queue depth on a SCSI device
scsi_assign_lock - replace default host_lock with given lock
scsi_bios_ptable - return copy of block device's partition table
scsi_block_requests - prevent further commands being queued to given host
scsi_deactivate_tcq - turn off tag command queueing
scsi_delete_timer - cancel timer on a SCSI command.
scsi_host_alloc - return a new scsi_host instance whose refcount==1
scsi_host_get - increments Scsi_Host instance's refcount
scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
Expand Down Expand Up @@ -457,27 +455,6 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost,
int scsi_add_host(struct Scsi_Host *shost, struct device * dev)


/**
* scsi_add_timer - (re-)start timer on a SCSI command.
* @scmd: pointer to scsi command instance
* @timeout: duration of timeout in "jiffies"
* @complete: pointer to function to call if timeout expires
*
* Returns nothing
*
* Might block: no
*
* Notes: Each scsi command has its own timer, and as it is added
* to the queue, we set up the timer. When the command completes,
* we cancel the timer. An LLD can use this function to change
* the existing timeout value.
*
* Defined in: drivers/scsi/scsi_error.c
**/
void scsi_add_timer(struct scsi_cmnd *scmd, int timeout,
void (*complete)(struct scsi_cmnd *))


/**
* scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device
* @sdev: pointer to SCSI device to change queue depth on
Expand Down Expand Up @@ -565,24 +542,6 @@ void scsi_block_requests(struct Scsi_Host * shost)
void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)


/**
* scsi_delete_timer - cancel timer on a SCSI command.
* @scmd: pointer to scsi command instance
*
* Returns 1 if able to cancel timer else 0 (i.e. too late or already
* cancelled).
*
* Might block: no [may in the future if it invokes del_timer_sync()]
*
* Notes: All commands issued by upper levels already have a timeout
* associated with them. An LLD can use this function to cancel the
* timer.
*
* Defined in: drivers/scsi/scsi_error.c
**/
int scsi_delete_timer(struct scsi_cmnd *scmd)


/**
* scsi_host_alloc - create a scsi host adapter instance and perform basic
* initialization.
Expand Down
67 changes: 45 additions & 22 deletions drivers/base/attribute_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@
/* This is a private structure used to tie the classdev and the
* container .. it should never be visible outside this file */
struct internal_container {
struct list_head node;
struct klist_node node;
struct attribute_container *cont;
struct class_device classdev;
};

static void internal_container_klist_get(struct klist_node *n)
{
struct internal_container *ic =
container_of(n, struct internal_container, node);
class_device_get(&ic->classdev);
}

static void internal_container_klist_put(struct klist_node *n)
{
struct internal_container *ic =
container_of(n, struct internal_container, node);
class_device_put(&ic->classdev);
}


/**
* attribute_container_classdev_to_container - given a classdev, return the container
*
Expand Down Expand Up @@ -57,8 +72,8 @@ int
attribute_container_register(struct attribute_container *cont)
{
INIT_LIST_HEAD(&cont->node);
INIT_LIST_HEAD(&cont->containers);
spin_lock_init(&cont->containers_lock);
klist_init(&cont->containers,internal_container_klist_get,
internal_container_klist_put);

down(&attribute_container_mutex);
list_add_tail(&cont->node, &attribute_container_list);
Expand All @@ -78,13 +93,13 @@ attribute_container_unregister(struct attribute_container *cont)
{
int retval = -EBUSY;
down(&attribute_container_mutex);
spin_lock(&cont->containers_lock);
if (!list_empty(&cont->containers))
spin_lock(&cont->containers.k_lock);
if (!list_empty(&cont->containers.k_list))
goto out;
retval = 0;
list_del(&cont->node);
out:
spin_unlock(&cont->containers_lock);
spin_unlock(&cont->containers.k_lock);
up(&attribute_container_mutex);
return retval;

Expand Down Expand Up @@ -143,7 +158,6 @@ attribute_container_add_device(struct device *dev,
continue;
}
memset(ic, 0, sizeof(struct internal_container));
INIT_LIST_HEAD(&ic->node);
ic->cont = cont;
class_device_initialize(&ic->classdev);
ic->classdev.dev = get_device(dev);
Expand All @@ -154,13 +168,22 @@ attribute_container_add_device(struct device *dev,
fn(cont, dev, &ic->classdev);
else
attribute_container_add_class_device(&ic->classdev);
spin_lock(&cont->containers_lock);
list_add_tail(&ic->node, &cont->containers);
spin_unlock(&cont->containers_lock);
klist_add_tail(&ic->node, &cont->containers);
}
up(&attribute_container_mutex);
}

/* FIXME: can't break out of this unless klist_iter_exit is also
* called before doing the break
*/
#define klist_for_each_entry(pos, head, member, iter) \
for (klist_iter_init(head, iter); (pos = ({ \
struct klist_node *n = klist_next(iter); \
n ? container_of(n, typeof(*pos), member) : \
({ klist_iter_exit(iter) ; NULL; }); \
}) ) != NULL; )


/**
* attribute_container_remove_device - make device eligible for removal.
*
Expand All @@ -187,26 +210,26 @@ attribute_container_remove_device(struct device *dev,

down(&attribute_container_mutex);
list_for_each_entry(cont, &attribute_container_list, node) {
struct internal_container *ic, *tmp;
struct internal_container *ic;
struct klist_iter iter;

if (attribute_container_no_classdevs(cont))
continue;

if (!cont->match(cont, dev))
continue;
spin_lock(&cont->containers_lock);
list_for_each_entry_safe(ic, tmp, &cont->containers, node) {

klist_for_each_entry(ic, &cont->containers, node, &iter) {
if (dev != ic->classdev.dev)
continue;
list_del(&ic->node);
klist_del(&ic->node);
if (fn)
fn(cont, dev, &ic->classdev);
else {
attribute_container_remove_attrs(&ic->classdev);
class_device_unregister(&ic->classdev);
}
}
spin_unlock(&cont->containers_lock);
}
up(&attribute_container_mutex);
}
Expand All @@ -232,7 +255,8 @@ attribute_container_device_trigger(struct device *dev,

down(&attribute_container_mutex);
list_for_each_entry(cont, &attribute_container_list, node) {
struct internal_container *ic, *tmp;
struct internal_container *ic;
struct klist_iter iter;

if (!cont->match(cont, dev))
continue;
Expand All @@ -242,12 +266,10 @@ attribute_container_device_trigger(struct device *dev,
continue;
}

spin_lock(&cont->containers_lock);
list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
klist_for_each_entry(ic, &cont->containers, node, &iter) {
if (dev == ic->classdev.dev)
fn(cont, dev, &ic->classdev);
}
spin_unlock(&cont->containers_lock);
}
up(&attribute_container_mutex);
}
Expand Down Expand Up @@ -397,15 +419,16 @@ attribute_container_find_class_device(struct attribute_container *cont,
{
struct class_device *cdev = NULL;
struct internal_container *ic;
struct klist_iter iter;

spin_lock(&cont->containers_lock);
list_for_each_entry(ic, &cont->containers, node) {
klist_for_each_entry(ic, &cont->containers, node, &iter) {
if (ic->classdev.dev == dev) {
cdev = &ic->classdev;
/* FIXME: must exit iterator then break */
klist_iter_exit(&iter);
break;
}
}
spin_unlock(&cont->containers_lock);

return cdev;
}
Expand Down
19 changes: 17 additions & 2 deletions drivers/message/fusion/lsi/mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000
*
* mpi.h Version: 01.05.07
* mpi.h Version: 01.05.08
*
* Version History
* ---------------
Expand Down Expand Up @@ -71,6 +71,9 @@
* 03-11-05 01.05.07 Removed function codes for SCSI IO 32 and
* TargetAssistExtended requests.
* Removed EEDP IOCStatus codes.
* 06-24-05 01.05.08 Added function codes for SCSI IO 32 and
* TargetAssistExtended requests.
* Added EEDP IOCStatus codes.
* --------------------------------------------------------------------------
*/

Expand Down Expand Up @@ -101,7 +104,7 @@
/* Note: The major versions of 0xe0 through 0xff are reserved */

/* versioning for this MPI header set */
#define MPI_HEADER_VERSION_UNIT (0x09)
#define MPI_HEADER_VERSION_UNIT (0x0A)
#define MPI_HEADER_VERSION_DEV (0x00)
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
Expand Down Expand Up @@ -292,10 +295,13 @@
#define MPI_FUNCTION_DIAG_BUFFER_POST (0x1D)
#define MPI_FUNCTION_DIAG_RELEASE (0x1E)

#define MPI_FUNCTION_SCSI_IO_32 (0x1F)

#define MPI_FUNCTION_LAN_SEND (0x20)
#define MPI_FUNCTION_LAN_RECEIVE (0x21)
#define MPI_FUNCTION_LAN_RESET (0x22)

#define MPI_FUNCTION_TARGET_ASSIST_EXTENDED (0x23)
#define MPI_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24)
#define MPI_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25)

Expand Down Expand Up @@ -680,6 +686,15 @@ typedef struct _MSG_DEFAULT_REPLY
#define MPI_IOCSTATUS_SCSI_IOC_TERMINATED (0x004B)
#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C)

/****************************************************************************/
/* For use by SCSI Initiator and SCSI Target end-to-end data protection */
/****************************************************************************/

#define MPI_IOCSTATUS_EEDP_GUARD_ERROR (0x004D)
#define MPI_IOCSTATUS_EEDP_REF_TAG_ERROR (0x004E)
#define MPI_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004F)


/****************************************************************************/
/* SCSI Target values */
/****************************************************************************/
Expand Down
Loading

0 comments on commit 17fa53d

Please sign in to comment.