All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murthy Bhat <Murthy.Bhat@pmcs.com>
To: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>,
	"JBottomley@Parallels.com" <JBottomley@Parallels.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "aacraid@pmc-sierra.com" <aacraid@pmc-sierra.com>,
	Harry Yang <Harry.Yang@pmcs.com>,
	Achim Leubner <Achim.Leubner@pmcs.com>,
	Rajinikanth Pandurangan <Rajinikanth.Pandurangan@pmcs.com>,
	Rich Bono <Rich.Bono@pmcs.com>
Subject: RE: [PATCH 7/7] aacraid: AIF raw device remove support
Date: Tue, 17 Mar 2015 07:07:11 +0000	[thread overview]
Message-ID: <13272BDD18A5F44CB23C497D29A37252A648A04C@BBYEXM01.pmc-sierra.internal> (raw)
In-Reply-To: <1425458313-1956-8-git-send-email-Mahesh.Rajashekhara@pmcs.com>

Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>

-----Original Message-----
From: Mahesh Rajashekhara 
Sent: Wednesday, March 04, 2015 2:09 PM
To: JBottomley@Parallels.com; linux-scsi@vger.kernel.org
Cc: aacraid@pmc-sierra.com; Harry Yang; Achim Leubner; Rajinikanth Pandurangan; Rich Bono; Mahesh Rajashekhara
Subject: [PATCH 7/7] aacraid: AIF raw device remove support

Add AIF raw device remove support

Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
---
 drivers/scsi/aacraid/aacraid.h |    3 +++
 drivers/scsi/aacraid/commsup.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 74a0440..5aaa9a6 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -2061,6 +2061,9 @@ extern struct aac_common aac_config;
 /* PMC NEW COMM: Request the event data */
 #define		AifReqEvent		200
 
+/* RAW device deleted */
+#define		AifRawDeviceRemove	203
+
 /*
  *	Adapter Initiated FIB command structures. Start with the adapter
  *	initiated FIBs that really come from the adapter, and get responded
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 0555023..8bb9ee4 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -884,6 +884,38 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 	switch (le32_to_cpu(aifcmd->command)) {
 	case AifCmdDriverNotify:
 		switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) {
+		case AifRawDeviceRemove:
+			container = le32_to_cpu(((__le32 *)aifcmd->data)[1]);
+			if ((container >> 28)) {
+				container = (u32)-1;
+				break;
+			}
+			channel = (container >> 24) & 0xF;
+			if (channel >= dev->maximum_num_channels) {
+				container = (u32)-1;
+				break;
+			}
+			id = container & 0xFFFF;
+			if (id >= dev->maximum_num_physicals) {
+				container = (u32)-1;
+				break;
+			}
+			lun = (container >> 16) & 0xFF;
+			container = (u32)-1;
+			channel = aac_phys_to_logical(channel);
+			device_config_needed =
+			  (((__le32 *)aifcmd->data)[0] ==
+			    cpu_to_le32(AifRawDeviceRemove)) ? DELETE : ADD;
+
+			if (device_config_needed == ADD) {
+				device = scsi_device_lookup(dev->scsi_host_ptr, channel, id, lun);
+				if (device) {
+					scsi_remove_device(device);
+					scsi_device_put(device);
+				}
+			}
+			break;
+
 		/*
 		 *	Morph or Expand complete
 		 */
-- 
1.7.7.3


  reply	other threads:[~2015-03-17  7:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04  8:38 [PATCH 0/7] aacraid driver updates Mahesh Rajashekhara
2015-03-04  8:38 ` [PATCH 1/7] aacraid: AIF support for SES device add/remove Mahesh Rajashekhara
2015-03-17  7:05   ` Murthy Bhat
2015-03-17 15:24   ` Achim Leubner
2015-03-18 11:02     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 2/7] aacraid: IOCTL pass-through command fix Mahesh Rajashekhara
2015-03-17  7:06   ` Murthy Bhat
2015-03-17 15:26   ` Achim Leubner
2015-03-18 11:03     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 3/7] aacraid: 4KB sector support Mahesh Rajashekhara
2015-03-17  7:06   ` Murthy Bhat
2015-03-17 15:26   ` Achim Leubner
2015-03-18 11:06     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 4/7] aacraid: MSI-x support Mahesh Rajashekhara
2015-03-17  7:06   ` Murthy Bhat
2015-03-17 15:27   ` Achim Leubner
2015-03-18 11:18     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 5/7] aacraid: vpd page code 0x83 support Mahesh Rajashekhara
2015-03-17  7:06   ` Murthy Bhat
2015-03-17 15:27   ` Achim Leubner
2015-03-18 11:26     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 6/7] aacraid: performance improvement changes Mahesh Rajashekhara
2015-03-17  7:07   ` Murthy Bhat
2015-03-17 15:27   ` Achim Leubner
2015-03-18 11:27     ` Hannes Reinecke
2015-03-04  8:38 ` [PATCH 7/7] aacraid: AIF raw device remove support Mahesh Rajashekhara
2015-03-17  7:07   ` Murthy Bhat [this message]
2015-03-17 15:28   ` Achim Leubner
2015-03-18 11:29     ` Hannes Reinecke
2015-03-26 14:43       ` Mahesh Rajashekhara
2015-03-16 11:24 ` [PATCH 0/7] aacraid driver updates Mahesh Rajashekhara
2015-03-16 12:49   ` James Bottomley

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=13272BDD18A5F44CB23C497D29A37252A648A04C@BBYEXM01.pmc-sierra.internal \
    --to=murthy.bhat@pmcs.com \
    --cc=Achim.Leubner@pmcs.com \
    --cc=Harry.Yang@pmcs.com \
    --cc=JBottomley@Parallels.com \
    --cc=Mahesh.Rajashekhara@pmcs.com \
    --cc=Rajinikanth.Pandurangan@pmcs.com \
    --cc=Rich.Bono@pmcs.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=linux-scsi@vger.kernel.org \
    /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.