From: Rob Kenna <rkenna@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
Date: Fri, 30 Sep 2005 16:44:27 -0400 [thread overview]
Message-ID: <433DA3AB.9010900@redhat.com> (raw)
In-Reply-To: <1128109342.24395.26.camel@max>
Hey Mike -
Is this for HP active/passive support? Thanks.
- Rob
Mike Christie wrote:
>This the basic handler but cleaned up. HP pointed me
>to some qlogic code I can use to get more info so I
>hope to integrate some of that code when I get a chance.
>
>Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>
>diff -Naurp linux-2.6.14-rc2/drivers/md/dm-hp-sw.c linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c
>--- linux-2.6.14-rc2/drivers/md/dm-hp-sw.c 1969-12-31 18:00:00.000000000 -0600
>+++ linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c 2005-09-30 14:12:58.000000000 -0500
>@@ -0,0 +1,108 @@
>+/*
>+ * Copyright (C) 2005 Mike Christie, All rights reserved.
>+ *
>+ * This file is released under the GPL.
>+ *
>+ * Basic, very basic, support for HP StorageWorks and FSC FibreCat
>+ */
>+#include <scsi/scsi.h>
>+#include <scsi/scsi_eh.h>
>+#include <scsi/scsi_cmnd.h>
>+#include <scsi/scsi_device.h>
>+#include <scsi/scsi_dbg.h>
>+
>+#include "dm.h"
>+#include "dm-hw-handler.h"
>+
>+static unsigned emc_rq_error(struct path *path, int result,
>+ struct scsi_sense_hdr *sense)
>+{
>+ DMINFO("hp_sw: hp_sw_endio 0x%x", result);
>+ /*
>+ * TODO: get info from qlogic failover driver and
>+ * eval sense/ASC/ASCQ
>+ */
>+ /*
>+ * just return true and send down the IO to see
>+ * if it worked for now
>+ */
>+ if (scsi_sense_valid(sense))
>+ scsi_print_sense_hdr("dm-hp-sw", sense);
>+ return 0;
>+}
>+
>+static void hp_sw_pg_init(struct hw_handler *hwh, unsigned bypassed,
>+ struct path *path)
>+{
>+ unsigned char cmd[MAX_COMMAND_SIZE];
>+
>+ memset(cmd, 0, MAX_COMMAND_SIZE);
>+ cmd[0] = START_STOP;
>+ /* Start spin cycle */
>+ cmd[4] = 1;
>+
>+ DMINFO("hp_sw: queueing START_STOP command on %s",
>+ path->dev->name);
>+
>+ if (dm_scsi_execute_rq(hwh, path, cmd, DMA_NONE, NULL, 0, 60 * HZ,
>+ __GFP_WAIT))
>+ dm_pg_init_complete(path, MP_FAIL_PATH);
>+}
>+
>+/*
>+ * Placeholders for coming code
>+ */
>+static int hp_sw_create(struct hw_handler *hwh, unsigned argc, char **argv)
>+{
>+ int err;
>+
>+ err = dm_scsi_init_context_pool(hwh);
>+ if (err) {
>+ DMERR("hp_sw: could not setup context pool");
>+ return err;
>+ }
>+ return 0;
>+}
>+
>+static void hp_sw_destroy(struct hw_handler *hwh)
>+{
>+ dm_scsi_destroy_context_pool(hwh);
>+}
>+
>+static struct hw_handler_type hp_sw_hwh = {
>+ .name = "hp_sw",
>+ .module = THIS_MODULE,
>+ .create = hp_sw_create,
>+ .destroy = hp_sw_destroy,
>+ .pg_init = hp_sw_pg_init,
>+ .rq_error = emc_rq_error,
>+};
>+
>+static int __init hp_sw_init(void)
>+{
>+ int r;
>+
>+ r = dm_register_hw_handler(&hp_sw_hwh);
>+ if (r < 0)
>+ DMERR("hp_sw: register failed %d", r);
>+
>+ DMINFO("hp_sw version 0.4 loaded");
>+
>+ return r;
>+}
>+
>+static void __exit hp_sw_exit(void)
>+{
>+ int r;
>+
>+ r = dm_unregister_hw_handler(&hp_sw_hwh);
>+ if (r < 0)
>+ DMERR("hp_sw: unregister failed %d", r);
>+}
>+
>+module_init(hp_sw_init);
>+module_exit(hp_sw_exit);
>+
>+MODULE_DESCRIPTION("HP StorageWorks and FSC FibreCat support for dm-multipath");
>+MODULE_AUTHOR("Mike Christie <michaelc@cs.wisc.edu>");
>+MODULE_LICENSE("GPL");
>diff -Naurp linux-2.6.14-rc2/drivers/md/Kconfig linux-2.6.14-rc2.work/drivers/md/Kconfig
>--- linux-2.6.14-rc2/drivers/md/Kconfig 2005-09-19 22:00:41.000000000 -0500
>+++ linux-2.6.14-rc2.work/drivers/md/Kconfig 2005-09-30 00:05:37.000000000 -0500
>@@ -236,5 +236,10 @@ config DM_MULTIPATH_EMC
> ---help---
> Multipath support for EMC CX/AX series hardware.
>
>+config DM_MULTIPATH_HP_SW
>+ tristate "HP StorageWorks and FSC FibreCat support"
>+ depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL
>+ ---help---
>+ HP StorageWorks and FSC FibreCat support for dm-multipath.
> endmenu
>
>diff -Naurp linux-2.6.14-rc2/drivers/md/Makefile linux-2.6.14-rc2.work/drivers/md/Makefile
>--- linux-2.6.14-rc2/drivers/md/Makefile 2005-09-19 22:00:41.000000000 -0500
>+++ linux-2.6.14-rc2.work/drivers/md/Makefile 2005-09-30 00:05:37.000000000 -0500
>@@ -34,6 +34,7 @@ obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o
> obj-$(CONFIG_DM_CRYPT) += dm-crypt.o
> obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o
> obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o
>+obj-$(CONFIG_DM_MULTIPATH_HP_SW) += dm-hp-sw.o
> obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o
> obj-$(CONFIG_DM_MIRROR) += dm-mirror.o
> obj-$(CONFIG_DM_ZERO) += dm-zero.o
>
>
>--
>dm-devel mailing list
>dm-devel@redhat.com
>https://www.redhat.com/mailman/listinfo/dm-devel
>
>
--
Robert Kenna / Red Hat
Sr Product Mgr - Storage
10 Technology Park Drive
Westford, MA 01886
o: (978) 392-2410 (x22410)
f: (978) 392-1001
c: (978) 771-6314
rkenna@redhat.com
next prev parent reply other threads:[~2005-09-30 20:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-30 19:42 [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler Mike Christie
2005-09-30 20:44 ` Rob Kenna [this message]
2005-09-30 20:52 ` Christophe Varoqui
2005-09-30 21:41 ` Mike Christie
2005-09-30 22:01 ` Christophe Varoqui
2005-09-30 23:07 ` Ed Wilts
2005-09-30 23:04 ` Ed Wilts
2005-10-01 8:27 ` Guy Coates
2005-09-30 20:57 ` Mike Christie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=433DA3AB.9010900@redhat.com \
--to=rkenna@redhat.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.