Commit 08c6c3c
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- arch
- arm64/configs
- loongarch/configs
- x86/configs
- drivers/scsi
- leapraid
13 files changed
+16163
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| 1047 | + | |
1047 | 1048 | | |
1048 | 1049 | | |
1049 | 1050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
| 997 | + | |
997 | 998 | | |
998 | 999 | | |
999 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
| 926 | + | |
926 | 927 | | |
927 | 928 | | |
928 | 929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments