Skip to content

Commit 08c6c3c

Browse files
Hao Dongdongopsiff
authored andcommitted
scsi: leapraid: supports LeapRaid controller
The LeapRAID driver provides support for LeapRAID PCIe RAID controllers, enabling communication between the host operating system, firmware, and hardware for efficient storage management. The main source files are organized as follows: leapraid_os.c: Implements the scsi_host_template functions, PCIe device probing, and initialization routines, integrating the driver with the Linux SCSI subsystem. leapraid_func.c: Provides the core functional routines that handle low-level interactions with the controller firmware and hardware, including interrupt handling, topology management, and reset sequence processing, and other related operations. leapraid_app.c: Implements the ioctl interface, providing user-space tools access to device management and diagnostic operations. leapraid_transport.c: Interacts with the Linux SCSI transport layer to add SAS phys and ports. leapraid_func.h: Declares common data structures, constants, and function prototypes shared across the driver. leapraid.h: Provides global constants, register mappings, and interface definitions that facilitate communication between the driver and the controller firmware. The leapraid_probe function is called when the driver detects a supported LeapRAID PCIe device. It allocates and initializes the Scsi_Host structure, configures hardware and firmware interfaces, and registers the host adapter with the Linux SCSI mid-layer. After registration, the driver invokes scsi_scan_host() to initiate device discovery. The firmware then reports discovered logical and physical devices to the host through interrupt-driven events and synchronizes their operational states. leapraid_adapter is the core data structure that encapsulates all resources and runtime state information maintained during driver operation, described as follows: /** * struct leapraid_adapter - Main LeapRaid adapter structure * @list: List head for adapter management * @shost: SCSI host structure * @pdev: PCI device structure * @iomem_base: I/O memory mapped base address * @rep_msg_host_idx: Host index for reply messages * @mask_int: Interrupt masking flag * @timestamp_sync_cnt: Timestamp synchronization counter * @adapter_attr: Adapter attributes * @mem_desc: Memory descriptor * @driver_cmds: Driver commands * @dynamic_task_desc: Dynamic task descriptor * @fw_evt_s: Firmware event structure * @notification_desc: Notification descriptor * @reset_desc: Reset descriptor * @scan_dev_desc: Device scan descriptor * @access_ctrl: Access control * @fw_log_desc: Firmware log descriptor * @dev_topo: Device topology * @boot_devs: Boot devices * @smart_poll_desc: SMART polling descriptor */ struct leapraid_adapter { struct list_head list; struct Scsi_Host *shost; struct pci_dev *pdev; struct leapraid_reg_base __iomem *iomem_base; u32 rep_msg_host_idx; bool mask_int; u32 timestamp_sync_cnt; struct leapraid_adapter_attr adapter_attr; struct leapraid_mem_desc mem_desc; struct leapraid_driver_cmds driver_cmds; struct leapraid_dynamic_task_desc dynamic_task_desc; struct leapraid_fw_evt_struct fw_evt_s; struct leapraid_notification_desc notification_desc; struct leapraid_reset_desc reset_desc; struct leapraid_scan_dev_desc scan_dev_desc; struct leapraid_access_ctrl access_ctrl; struct leapraid_fw_log_desc fw_log_desc; struct leapraid_dev_topo dev_topo; struct leapraid_boot_devs boot_devs; struct leapraid_smart_poll_desc smart_poll_desc; }; Signed-off-by: Hao Dongdong <doubled@leap-io-kernel.com>
1 parent 4033c3b commit 08c6c3c

File tree

13 files changed

+16163
-0
lines changed

13 files changed

+16163
-0
lines changed

arch/arm64/configs/deepin_arm64_desktop_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ CONFIG_MEGARAID_LEGACY=m
10441044
CONFIG_MEGARAID_SAS=m
10451045
CONFIG_SCSI_MPT2SAS=m
10461046
CONFIG_SCSI_MPI3MR=m
1047+
CONFIG_SCSI_LEAPRAID=m
10471048
CONFIG_SCSI_SMARTPQI=m
10481049
CONFIG_SCSI_HPTIOP=m
10491050
CONFIG_SCSI_BUSLOGIC=m

arch/loongarch/configs/deepin_loongarch_desktop_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ CONFIG_MEGARAID_LEGACY=m
994994
CONFIG_MEGARAID_SAS=m
995995
CONFIG_SCSI_MPT2SAS=m
996996
CONFIG_SCSI_MPI3MR=m
997+
CONFIG_SCSI_LEAPRAID=m
997998
CONFIG_SCSI_SMARTPQI=m
998999
CONFIG_SCSI_HPTIOP=m
9991000
CONFIG_SCSI_BUSLOGIC=m

arch/x86/configs/deepin_x86_desktop_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ CONFIG_MEGARAID_MAILBOX=m
923923
CONFIG_MEGARAID_LEGACY=m
924924
CONFIG_MEGARAID_SAS=m
925925
CONFIG_SCSI_MPT2SAS=m
926+
CONFIG_SCSI_LEAPRAID=m
926927
CONFIG_SCSI_SMARTPQI=m
927928
CONFIG_SCSI_HPTIOP=m
928929
CONFIG_SCSI_BUSLOGIC=m

drivers/scsi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ source "drivers/scsi/esas2r/Kconfig"
502502
source "drivers/scsi/megaraid/Kconfig.megaraid"
503503
source "drivers/scsi/mpt3sas/Kconfig"
504504
source "drivers/scsi/mpi3mr/Kconfig"
505+
source "drivers/scsi/leapraid/Kconfig"
505506
source "drivers/scsi/smartpqi/Kconfig"
506507

507508
config SCSI_HPTIOP

drivers/scsi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ obj-$(CONFIG_SCSI_BFA_FC) += bfa/
9191
obj-$(CONFIG_SCSI_CHELSIO_FCOE) += csiostor/
9292
obj-$(CONFIG_SCSI_DMX3191D) += dmx3191d.o
9393
obj-$(CONFIG_SCSI_HPSA) += hpsa.o
94+
obj-$(CONFIG_SCSI_LEAPRAID) += leapraid/
9495
obj-$(CONFIG_SCSI_SMARTPQI) += smartpqi/
9596
obj-$(CONFIG_SCSI_SYM53C8XX_2) += sym53c8xx_2/
9697
obj-$(CONFIG_SCSI_ZALON) += zalon7xx.o

drivers/scsi/leapraid/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
config SCSI_LEAPRAID
4+
tristate "LeapIO RAID Adapter"
5+
depends on PCI && SCSI
6+
select SCSI_SAS_ATTRS
7+
help
8+
This driver supports LeapIO PCIe-based Storage
9+
and RAID controllers.
10+
11+
<http://www.leap-io.com>
12+
13+
To compile this driver as a module, choose M here: the
14+
resulting kernel module will be named leapraid.

drivers/scsi/leapraid/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
#
3+
# Makefile for the LEAPRAID drivers.
4+
#
5+
6+
obj-$(CONFIG_SCSI_LEAPRAID) += leapraid.o
7+
leapraid-objs += leapraid_func.o \
8+
leapraid_os.o \
9+
leapraid_transport.o \
10+
leapraid_app.o

0 commit comments

Comments
 (0)