From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org
Cc: David.Carroll@microsemi.com, Gana.Sridaran@microsemi.com,
RaghavaAditya.Renukunta@microsemi.com,
Scott.Banesh@microsemi.com
Subject: [PATCH 21/24] aacraid: Retrieve HBA host information ioctl
Date: Mon, 23 Jan 2017 10:09:05 -0800 [thread overview]
Message-ID: <20170123180908.3465-22-RaghavaAditya.Renukunta@microsemi.com> (raw)
In-Reply-To: <20170123180908.3465-1-RaghavaAditya.Renukunta@microsemi.com>
Added a new ioctl interface to retrieve the host device information.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Dave Carroll <David.Carroll@microsemi.com>
---
drivers/scsi/aacraid/aacraid.h | 52 +++++++++++++++++++++++++++++++++++++++++
drivers/scsi/aacraid/commctrl.c | 26 +++++++++++++++++++++
2 files changed, 78 insertions(+)
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index a94a07d..52a2264 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -2338,6 +2338,7 @@ struct revision
#define FSACTL_GET_CONTAINERS 2131
#define FSACTL_SEND_LARGE_FIB CTL_CODE(2138, METHOD_BUFFERED)
#define FSACTL_RESET_IOP CTL_CODE(2140, METHOD_BUFFERED)
+#define FSACTL_GET_HBA_INFO CTL_CODE(2150, METHOD_BUFFERED)
/* flags defined for IOP & HW SOFT RESET */
#define HW_IOP_RESET 0x01
#define HW_SOFT_RESET 0x02
@@ -2377,6 +2378,57 @@ struct aac_common
extern struct aac_common aac_config;
/*
+ * This is for management ioctl purpose only.
+ */
+struct aac_hba_info {
+
+ u8 DriverName[50];
+ u8 AdapterNumber;
+ u8 SystemIoBusNumber;
+ u8 DeviceNumber;
+ u32 FunctionNumber;
+ u32 VendorID;
+ u32 DeviceID;
+ u32 SubVendorID;
+ u32 SubSystemID;
+ u32 MappedBaseAddressSize;
+ u32 BasePhysicalAddress_HighPart;
+ u32 BasePhysicalAddress_LowPart;
+
+ u32 MaxCommandSize;
+ u32 MaxFibSize;
+ u32 MaxScatterGatherFromOs;
+ u32 MaxScatterGatherToFw;
+ u32 MaxOutstandingFibs;
+
+ u32 QueueStartThreshold;
+ u32 QueueDumpThreshold;
+ u32 MaxIoSizeQueued;
+ u32 OutstandingIO;
+
+ u32 FirmwareBuildNumber;
+ u32 BIOSBuildNumber;
+ u32 DriverBuildNumber;
+ u32 SerialNumber_HighPart;
+ u32 SerialNumber_LowPart;
+ u32 SupportedOptions;
+ u32 FeatureBits;
+ u32 currentnumberPorts;
+
+ u8 NewCommInterface:1;
+ u8 NewCommandsSupported:1;
+ u8 DisablePassthrough:1;
+ u8 ExposeNonDasd:1;
+ u8 QueueAllowed:1;
+ u8 BLEDCheckEnabled:1;
+ u8 reserved1:1;
+ u8 reserted2:1;
+
+ u32 reserved3[10];
+
+};
+
+/*
* The following macro is used when sending and receiving FIBs. It is
* only used for debugging.
*/
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 4b65b91..9ade2b4 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -1011,6 +1011,29 @@ static int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
}
return 0;
}
+
+static int aac_get_hba_info(struct aac_dev *dev, void __user *arg)
+{
+ struct aac_hba_info hbainfo;
+
+ hbainfo.AdapterNumber = (u8) dev->id;
+ hbainfo.SystemIoBusNumber = dev->pdev->bus->number;
+ hbainfo.DeviceNumber = (dev->pdev->devfn >> 3);
+ hbainfo.FunctionNumber = (dev->pdev->devfn & 0x0007);
+
+ hbainfo.VendorID = dev->pdev->vendor;
+ hbainfo.DeviceID = dev->pdev->device;
+ hbainfo.SubVendorID = dev->pdev->subsystem_vendor;
+ hbainfo.SubSystemID = dev->pdev->subsystem_device;
+
+ if (copy_to_user(arg, &hbainfo, sizeof(struct aac_hba_info))) {
+ dprintk((KERN_DEBUG "aacraid: Could not copy hba info\n"));
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
struct aac_reset_iop {
u8 reset_type;
};
@@ -1070,6 +1093,9 @@ int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
case FSACTL_GET_PCI_INFO:
status = aac_get_pci_info(dev,arg);
break;
+ case FSACTL_GET_HBA_INFO:
+ status = aac_get_hba_info(dev, arg);
+ break;
case FSACTL_RESET_IOP:
status = aac_send_reset_adapter(dev, arg);
break;
--
2.7.4
next prev parent reply other threads:[~2017-01-24 0:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-23 18:08 [PATCH 00/24] aacraid: Patchset for Smart Family card support Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 01/24] aacraid: Remove duplicate irq management code Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 02/24] aacraid: Added aacraid.h include guard Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 03/24] aacraid: added support for init_struct_8 Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 04/24] aacraid: Added sa firmware support Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 05/24] aacraid: Retrieve and update the device types Raghava Aditya Renukunta
2017-01-24 1:53 ` kbuild test robot
2017-01-23 18:08 ` [PATCH 06/24] aacraid: Reworked scsi command submission path Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 07/24] aacraid: Process Error for response I/O Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 08/24] aacraid: Added support for response path Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 09/24] aacraid: Added support for read medium error Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 10/24] aacraid: Reworked aac_command_thread Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 11/24] aacraid: Added support for periodic wellness sync Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 12/24] aacraid: Retrieve Queue Depth from Adapter FW Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 13/24] aacraid: Added support to set QD of attached drives Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 14/24] aacraid: Added support for hotplug Raghava Aditya Renukunta
2017-01-23 18:08 ` [PATCH 15/24] aacraid: Include HBA direct interface Raghava Aditya Renukunta
2017-01-23 18:09 ` [PATCH 16/24] aacraid: Add task management functionality Raghava Aditya Renukunta
2017-01-24 3:39 ` kbuild test robot
2017-01-23 18:09 ` [PATCH 17/24] aacraid: Added support to abort cmd and reset lun Raghava Aditya Renukunta
2017-01-24 2:24 ` kbuild test robot
2017-01-23 18:09 ` [PATCH 18/24] aacraid: VPD 83 type3 support Raghava Aditya Renukunta
2017-01-23 18:09 ` [PATCH 19/24] aacraid: Added new IWBR reset Raghava Aditya Renukunta
2017-01-23 18:09 ` [PATCH 20/24] aacraid: Added ioctl to trigger IOP/IWBR reset Raghava Aditya Renukunta
2017-01-23 18:09 ` Raghava Aditya Renukunta [this message]
2017-01-23 18:09 ` [PATCH 22/24] aacraid: Update copyrights Raghava Aditya Renukunta
2017-01-23 18:09 ` [PATCH 23/24] aacraid: Change Driver Version Prefix Raghava Aditya Renukunta
2017-01-23 18:09 ` [PATCH 24/24] aacraid: update version Raghava Aditya Renukunta
2017-01-25 23:31 ` [PATCH 00/24] aacraid: Patchset for Smart Family card support Martin K. Petersen
2017-01-26 0:29 ` Raghava Aditya Renukunta
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=20170123180908.3465-22-RaghavaAditya.Renukunta@microsemi.com \
--to=raghavaaditya.renukunta@microsemi.com \
--cc=David.Carroll@microsemi.com \
--cc=Gana.Sridaran@microsemi.com \
--cc=Scott.Banesh@microsemi.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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.