Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *			Linux MegaRAID Unified device driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (c) 2003-2004  LSI Logic Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * FILE		: mbox_defs.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #ifndef _MRAID_MBOX_DEFS_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define _MRAID_MBOX_DEFS_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * Commands and states for mailbox based controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define MBOXCMD_LREAD		0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define MBOXCMD_LWRITE		0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define MBOXCMD_PASSTHRU	0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define MBOXCMD_ADPEXTINQ	0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define MBOXCMD_ADAPTERINQ	0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define MBOXCMD_LREAD64		0xA7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define MBOXCMD_LWRITE64	0xA8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define MBOXCMD_PASSTHRU64	0xC3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define MBOXCMD_EXTPTHRU	0xE3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define MAIN_MISC_OPCODE	0xA4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define GET_MAX_SG_SUPPORT	0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define SUPPORT_EXT_CDB		0x16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define FC_NEW_CONFIG		0xA1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define NC_SUBOP_PRODUCT_INFO	0x0E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #define NC_SUBOP_ENQUIRY3	0x0F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define ENQ3_GET_SOLICITED_FULL	0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define OP_DCMD_READ_CONFIG	0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define NEW_READ_CONFIG_8LD	0x67
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define READ_CONFIG_8LD		0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define FLUSH_ADAPTER		0x0A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #define FLUSH_SYSTEM		0xFE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * Command for random deletion of logical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define	FC_DEL_LOGDRV		0xA4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define	OP_SUP_DEL_LOGDRV	0x2A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define OP_GET_LDID_MAP		0x18
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define OP_DEL_LOGDRV		0x1C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  * BIOS commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #define IS_BIOS_ENABLED		0x62
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define GET_BIOS		0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #define CHNL_CLASS		0xA9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define GET_CHNL_CLASS		0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #define SET_CHNL_CLASS		0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define CH_RAID			0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #define CH_SCSI			0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) #define BIOS_PVT_DATA		0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #define GET_BIOS_PVT_DATA	0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  * Commands to support clustering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define GET_TARGET_ID		0x7D
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #define CLUSTER_OP		0x70
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) #define GET_CLUSTER_MODE	0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define CLUSTER_CMD		0x6E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define RESERVE_LD		0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #define RELEASE_LD		0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #define RESET_RESERVATIONS	0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define RESERVATION_STATUS	0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) #define RESERVE_PD		0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #define RELEASE_PD		0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * Module battery status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define BATTERY_MODULE_MISSING		0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) #define BATTERY_LOW_VOLTAGE		0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) #define BATTERY_TEMP_HIGH		0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) #define BATTERY_PACK_MISSING		0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #define BATTERY_CHARGE_MASK		0x30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) #define BATTERY_CHARGE_DONE		0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) #define BATTERY_CHARGE_INPROG		0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) #define BATTERY_CHARGE_FAIL		0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #define BATTERY_CYCLES_EXCEEDED		0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * Physical drive states.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #define PDRV_UNCNF	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) #define PDRV_ONLINE	3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) #define PDRV_FAILED	4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define PDRV_RBLD	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define PDRV_HOTSPARE	6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  * Raid logical drive states.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define RDRV_OFFLINE	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define RDRV_DEGRADED	1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define RDRV_OPTIMAL	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define RDRV_DELETED	3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  * Read, write and cache policies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #define NO_READ_AHEAD		0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define READ_AHEAD		1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define ADAP_READ_AHEAD		2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define WRMODE_WRITE_THRU	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define WRMODE_WRITE_BACK	1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define CACHED_IO		0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define DIRECT_IO		1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define MAX_LOGICAL_DRIVES_8LD		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define MAX_LOGICAL_DRIVES_40LD		40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define FC_MAX_PHYSICAL_DEVICES		256
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define MAX_MBOX_CHANNELS		5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #define MAX_MBOX_TARGET			15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) #define MBOX_MAX_PHYSICAL_DRIVES	MAX_MBOX_CHANNELS*MAX_MBOX_TARGET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #define MAX_ROW_SIZE_40LD		32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #define MAX_ROW_SIZE_8LD		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #define SPAN_DEPTH_8_SPANS		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) #define SPAN_DEPTH_4_SPANS		4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #define MAX_REQ_SENSE_LEN		0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  * struct mbox_t - Driver and f/w handshake structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)  * @cmd		: firmware command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  * @cmdid	: command id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)  * @numsectors	: number of sectors to be transferred
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  * @lba		: Logical Block Address on LD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * @xferaddr	: DMA address for data transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * @logdrv	: logical drive number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * @numsge	: number of scatter gather elements in sg list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * @resvd	: reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * @busy	: f/w busy, must wait to issue more commands.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  * @numstatus	: number of commands completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * @status	: status of the commands completed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  * @completed	: array of completed command ids.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  * @poll	: poll and ack sequence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  * @ack		: poll and ack sequence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  * The central handshake structure between the driver and the firmware. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  * structure must be allocated by the driver and aligned at 8-byte boundary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define MBOX_MAX_FIRMWARE_STATUS	46
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	uint8_t		cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	uint8_t		cmdid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	uint16_t	numsectors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	uint32_t	lba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	uint32_t	xferaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	uint8_t		logdrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	uint8_t		numsge;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	uint8_t		resvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	uint8_t		busy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	uint8_t		numstatus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	uint8_t		status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	uint8_t		completed[MBOX_MAX_FIRMWARE_STATUS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	uint8_t		poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	uint8_t		ack;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) } __attribute__ ((packed)) mbox_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  * mbox64_t - 64-bit extension for the mailbox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)  * @segment_lo	: the low 32-bits of the address of the scatter-gather list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)  * @segment_hi	: the upper 32-bits of the address of the scatter-gather list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)  * @mbox	: 32-bit mailbox, whose xferadder field must be set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)  *		0xFFFFFFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)  * This is the extension of the 32-bit mailbox to be able to perform DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  * beyond 4GB address range.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	uint32_t	xferaddr_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	uint32_t	xferaddr_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	mbox_t		mbox32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) } __attribute__ ((packed)) mbox64_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)  * mailbox structure used for internal commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	u8	cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	u8	cmdid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	u8	opcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	u8	subopcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	u32	lba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	u32	xferaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	u8	logdrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	u8	rsvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	u8	numstatus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) } __attribute__ ((packed)) int_mbox_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)  * mraid_passthru_t - passthru structure to issue commands to physical devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  * @timeout		: command timeout, 0=6sec, 1=60sec, 2=10min, 3=3hr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  * @ars			: set if ARS required after check condition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)  * @islogical		: set if command meant for logical devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)  * @logdrv		: logical drive number if command for LD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  * @channel		: Channel on which physical device is located
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * @target		: SCSI target of the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  * @queuetag		: unused
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  * @queueaction		: unused
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  * @cdb			: SCSI CDB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)  * @cdblen		: length of the CDB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  * @reqsenselen		: amount of request sense data to be returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  * @reqsensearea	: Sense information buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)  * @numsge		: number of scatter-gather elements in the sg list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)  * @scsistatus		: SCSI status of the command completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  * @dataxferaddr	: DMA data transfer address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  * @dataxferlen		: amount of the data to be transferred.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	uint8_t		timeout		:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	uint8_t		ars		:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	uint8_t		reserved	:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	uint8_t		islogical	:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	uint8_t		logdrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	uint8_t		channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	uint8_t		target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	uint8_t		queuetag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	uint8_t		queueaction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	uint8_t		cdb[10];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	uint8_t		cdblen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	uint8_t		reqsenselen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	uint8_t		reqsensearea[MAX_REQ_SENSE_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	uint8_t		numsge;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	uint8_t		scsistatus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	uint32_t	dataxferaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	uint32_t	dataxferlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) } __attribute__ ((packed)) mraid_passthru_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	uint32_t		dataxferaddr_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	uint32_t		dataxferaddr_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	mraid_passthru_t	pthru32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) } __attribute__ ((packed)) mega_passthru64_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)  * mraid_epassthru_t - passthru structure to issue commands to physical devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)  * @timeout		: command timeout, 0=6sec, 1=60sec, 2=10min, 3=3hr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)  * @ars			: set if ARS required after check condition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)  * @rsvd1		: reserved field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)  * @cd_rom		: (?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)  * @rsvd2		: reserved field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)  * @islogical		: set if command meant for logical devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)  * @logdrv		: logical drive number if command for LD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)  * @channel		: Channel on which physical device is located
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)  * @target		: SCSI target of the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  * @queuetag		: unused
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  * @queueaction		: unused
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  * @cdblen		: length of the CDB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  * @rsvd3		: reserved field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)  * @cdb			: SCSI CDB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)  * @numsge		: number of scatter-gather elements in the sg list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)  * @status		: SCSI status of the command completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)  * @reqsenselen		: amount of request sense data to be returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)  * @reqsensearea	: Sense information buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)  * @rsvd4		: reserved field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)  * @dataxferaddr	: DMA data transfer address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)  * @dataxferlen		: amount of the data to be transferred.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	uint8_t		timeout		:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	uint8_t		ars		:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	uint8_t		rsvd1		:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	uint8_t		cd_rom		:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	uint8_t		rsvd2		:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	uint8_t		islogical	:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	uint8_t		logdrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	uint8_t		channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	uint8_t		target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	uint8_t		queuetag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	uint8_t		queueaction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	uint8_t		cdblen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	uint8_t		rsvd3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	uint8_t		cdb[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	uint8_t		numsge;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	uint8_t		status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	uint8_t		reqsenselen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	uint8_t		reqsensearea[MAX_REQ_SENSE_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	uint8_t		rsvd4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	uint32_t	dataxferaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	uint32_t	dataxferlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) } __attribute__ ((packed)) mraid_epassthru_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)  * mraid_pinfo_t - product info, static information about the controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)  * @data_size		: current size in bytes (not including resvd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)  * @config_signature	: Current value is 0x00282008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)  * @fw_version		: Firmware version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)  * @bios_version	: version of the BIOS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)  * @product_name	: Name given to the controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)  * @max_commands	: Maximum concurrent commands supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)  * @nchannels		: Number of SCSI Channels detected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)  * @fc_loop_present	: Number of Fibre Loops detected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)  * @mem_type		: EDO, FPM, SDRAM etc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)  * @signature		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)  * @dram_size		: In terms of MB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)  * @subsysid		: device PCI subsystem ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)  * @subsysvid		: device PCI subsystem vendor ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)  * @notify_counters	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)  * @pad1k		: 135 + 889 resvd = 1024 total size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)  * This structures holds the information about the controller which is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)  * expected to change dynamically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)  * The current value of config signature is 0x00282008:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)  * 0x28 = MAX_LOGICAL_DRIVES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)  * 0x20 = Number of stripes and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)  * 0x08 = Number of spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	uint32_t	data_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	uint32_t	config_signature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	uint8_t		fw_version[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	uint8_t		bios_version[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	uint8_t		product_name[80];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	uint8_t		max_commands;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	uint8_t		nchannels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	uint8_t		fc_loop_present;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	uint8_t		mem_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	uint32_t	signature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	uint16_t	dram_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	uint16_t	subsysid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	uint16_t	subsysvid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	uint8_t		notify_counters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	uint8_t		pad1k[889];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) } __attribute__ ((packed)) mraid_pinfo_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)  * mraid_notify_t - the notification structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)  * @global_counter		: Any change increments this counter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)  * @param_counter		: Indicates any params changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)  * @param_id			: Param modified - defined below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)  * @param_val			: New val of last param modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)  * @write_config_counter	: write config occurred
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)  * @write_config_rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)  * @ldrv_op_counter		: Indicates ldrv op started/completed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)  * @ldrv_opid			: ldrv num
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)  * @ldrv_opcmd			: ldrv operation - defined below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)  * @ldrv_opstatus		: status of the operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)  * @ldrv_state_counter		: Indicates change of ldrv state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)  * @ldrv_state_id		: ldrv num
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)  * @ldrv_state_new		: New state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)  * @ldrv_state_old		: old state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)  * @pdrv_state_counter		: Indicates change of ldrv state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)  * @pdrv_state_id		: pdrv id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)  * @pdrv_state_new		: New state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)  * @pdrv_state_old		: old state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)  * @pdrv_fmt_counter		: Indicates pdrv format started/over
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)  * @pdrv_fmt_id			: pdrv id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)  * @pdrv_fmt_val		: format started/over
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)  * @pdrv_fmt_rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)  * @targ_xfer_counter		: Indicates SCSI-2 Xfer rate change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)  * @targ_xfer_id		: pdrv Id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)  * @targ_xfer_val		: new Xfer params of last pdrv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)  * @targ_xfer_rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)  * @fcloop_id_chg_counter	: Indicates loopid changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)  * @fcloopid_pdrvid		: pdrv id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)  * @fcloop_id0			: loopid on fc loop 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)  * @fcloop_id1			: loopid on fc loop 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)  * @fcloop_state_counter	: Indicates loop state changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)  * @fcloop_state0		: state of fc loop 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)  * @fcloop_state1		: state of fc loop 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)  * @fcloop_state_rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	uint32_t	global_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	uint8_t		param_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 	uint8_t		param_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	uint16_t	param_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	uint8_t		write_config_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	uint8_t		write_config_rsvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	uint8_t		ldrv_op_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	uint8_t		ldrv_opid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	uint8_t		ldrv_opcmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	uint8_t		ldrv_opstatus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	uint8_t		ldrv_state_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	uint8_t		ldrv_state_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	uint8_t		ldrv_state_new;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	uint8_t		ldrv_state_old;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	uint8_t		pdrv_state_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	uint8_t		pdrv_state_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	uint8_t		pdrv_state_new;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	uint8_t		pdrv_state_old;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	uint8_t		pdrv_fmt_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	uint8_t		pdrv_fmt_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 	uint8_t		pdrv_fmt_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 	uint8_t		pdrv_fmt_rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	uint8_t		targ_xfer_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	uint8_t		targ_xfer_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	uint8_t		targ_xfer_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	uint8_t		targ_xfer_rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	uint8_t		fcloop_id_chg_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	uint8_t		fcloopid_pdrvid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	uint8_t		fcloop_id0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	uint8_t		fcloop_id1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	uint8_t		fcloop_state_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	uint8_t		fcloop_state0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	uint8_t		fcloop_state1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	uint8_t		fcloop_state_rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) } __attribute__ ((packed)) mraid_notify_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424)  * mraid_inquiry3_t - enquiry for device information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)  * @data_size		: current size in bytes (not including resvd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)  * @notify		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)  * @notify_rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)  * @rebuild_rate	: rebuild rate (0% - 100%)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430)  * @cache_flush_int	: cache flush interval in seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)  * @sense_alert		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)  * @drive_insert_count	: drive insertion count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)  * @battery_status	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)  * @num_ldrv		: no. of Log Drives configured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)  * @recon_state		: state of reconstruct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)  * @ldrv_op_status	: logdrv Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)  * @ldrv_size		: size of each log drv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438)  * @ldrv_prop		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439)  * @ldrv_state		: state of log drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)  * @pdrv_state		: state of phys drvs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)  * @pdrv_format		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442)  * @targ_xfer		: phys device transfer rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)  * @pad1k		: 761 + 263reserved = 1024 bytes total size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) #define MAX_NOTIFY_SIZE		0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) #define CUR_NOTIFY_SIZE		sizeof(mraid_notify_t)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	uint32_t	data_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 	mraid_notify_t	notify;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	uint8_t		notify_rsvd[MAX_NOTIFY_SIZE - CUR_NOTIFY_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	uint8_t		rebuild_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 	uint8_t		cache_flush_int;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	uint8_t		sense_alert;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 	uint8_t		drive_insert_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	uint8_t		battery_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	uint8_t		num_ldrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	uint8_t		recon_state[MAX_LOGICAL_DRIVES_40LD / 8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	uint16_t	ldrv_op_status[MAX_LOGICAL_DRIVES_40LD / 8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	uint32_t	ldrv_size[MAX_LOGICAL_DRIVES_40LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	uint8_t		ldrv_prop[MAX_LOGICAL_DRIVES_40LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	uint8_t		ldrv_state[MAX_LOGICAL_DRIVES_40LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	uint8_t		pdrv_state[FC_MAX_PHYSICAL_DEVICES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	uint16_t	pdrv_format[FC_MAX_PHYSICAL_DEVICES / 16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	uint8_t		targ_xfer[80];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	uint8_t		pad1k[263];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) } __attribute__ ((packed)) mraid_inquiry3_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)  * mraid_adapinfo_t - information about the adapter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)  * @max_commands		: max concurrent commands supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479)  * @rebuild_rate		: rebuild rate - 0% thru 100%
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480)  * @max_targ_per_chan		: max targ per channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)  * @nchannels			: number of channels on HBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482)  * @fw_version			: firmware version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483)  * @age_of_flash		: number of times FW has been flashed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484)  * @chip_set_value		: contents of 0xC0000832
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)  * @dram_size			: in MB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486)  * @cache_flush_interval	: in seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487)  * @bios_version		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488)  * @board_type			:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489)  * @sense_alert			:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490)  * @write_config_count		: increase with every configuration change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)  * @drive_inserted_count	: increase with every drive inserted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492)  * @inserted_drive		: channel:Id of inserted drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493)  * @battery_status		: bit 0: battery module missing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494)  *				bit 1: VBAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495)  *				bit 2: temperature high
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496)  *				bit 3: battery pack missing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497)  *				bit 4,5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)  *					00 - charge complete
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499)  *					01 - fast charge in progress
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)  *					10 - fast charge fail
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501)  *					11 - undefined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502)  *				bit 6: counter > 1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503)  *				bit 7: Undefined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504)  * @dec_fault_bus_info		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 	uint8_t		max_commands;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 	uint8_t		rebuild_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 	uint8_t		max_targ_per_chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	uint8_t		nchannels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 	uint8_t		fw_version[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	uint16_t	age_of_flash;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 	uint8_t		chip_set_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 	uint8_t		dram_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	uint8_t		cache_flush_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 	uint8_t		bios_version[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 	uint8_t		board_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 	uint8_t		sense_alert;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 	uint8_t		write_config_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 	uint8_t		battery_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 	uint8_t		dec_fault_bus_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) } __attribute__ ((packed)) mraid_adapinfo_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526)  * mraid_ldrv_info_t - information about the logical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)  * @nldrv	: Number of logical drives configured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)  * @rsvd	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)  * @size	: size of each logical drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)  * @prop	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531)  * @state	: state of each logical drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) 	uint8_t		nldrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 	uint8_t		rsvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) 	uint32_t	size[MAX_LOGICAL_DRIVES_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) 	uint8_t		prop[MAX_LOGICAL_DRIVES_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 	uint8_t		state[MAX_LOGICAL_DRIVES_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) } __attribute__ ((packed)) mraid_ldrv_info_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543)  * mraid_pdrv_info_t - information about the physical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544)  * @pdrv_state	: state of each physical drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 	uint8_t		pdrv_state[MBOX_MAX_PHYSICAL_DRIVES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 	uint8_t		rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) } __attribute__ ((packed)) mraid_pdrv_info_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553)  * mraid_inquiry_t - RAID inquiry, mailbox command 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)  * @mraid_adapinfo_t	: adapter information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555)  * @mraid_ldrv_info_t	: logical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)  * @mraid_pdrv_info_t	: physical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 	mraid_adapinfo_t	adapter_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 	mraid_ldrv_info_t	logdrv_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 	mraid_pdrv_info_t	pdrv_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) } __attribute__ ((packed)) mraid_inquiry_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566)  * mraid_extinq_t - RAID extended inquiry, mailbox command 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568)  * @raid_inq		: raid inquiry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569)  * @phys_drv_format	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570)  * @stack_attn		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)  * @modem_status	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572)  * @rsvd		:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) 	mraid_inquiry_t	raid_inq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 	uint16_t	phys_drv_format[MAX_MBOX_CHANNELS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) 	uint8_t		stack_attn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 	uint8_t		modem_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 	uint8_t		rsvd[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) } __attribute__ ((packed)) mraid_extinq_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584)  * adap_device_t - device information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585)  * @channel	: channel fpor the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586)  * @target	: target ID of the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 	uint8_t		channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 	uint8_t		target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) }__attribute__ ((packed)) adap_device_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595)  * adap_span_40ld_t - 40LD span
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596)  * @start_blk	: starting block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)  * @num_blks	: number of blocks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 	uint32_t	start_blk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) 	uint32_t	num_blks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) 	adap_device_t	device[MAX_ROW_SIZE_40LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) }__attribute__ ((packed)) adap_span_40ld_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)  * adap_span_8ld_t - 8LD span
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608)  * @start_blk	: starting block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)  * @num_blks	: number of blocks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) 	uint32_t	start_blk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) 	uint32_t	num_blks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) 	adap_device_t	device[MAX_ROW_SIZE_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) }__attribute__ ((packed)) adap_span_8ld_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619)  * logdrv_param_t - logical drives parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621)  * @span_depth	: total number of spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622)  * @level	: RAID level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623)  * @read_ahead	: read ahead, no read ahead, adaptive read ahead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624)  * @stripe_sz	: encoded stripe size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625)  * @status	: status of the logical drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626)  * @write_mode	: write mode, write_through/write_back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627)  * @direct_io	: direct io or through cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628)  * @row_size	: number of stripes in a row
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) 	uint8_t		span_depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) 	uint8_t		level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) 	uint8_t		read_ahead;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) 	uint8_t		stripe_sz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) 	uint8_t		status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) 	uint8_t		write_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) 	uint8_t		direct_io;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) 	uint8_t		row_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) } __attribute__ ((packed)) logdrv_param_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643)  * logdrv_40ld_t - logical drive definition for 40LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644)  * @lparam	: logical drives parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645)  * @span	: span
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) 	logdrv_param_t		lparam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) 	adap_span_40ld_t	span[SPAN_DEPTH_8_SPANS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) }__attribute__ ((packed)) logdrv_40ld_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654)  * logdrv_8ld_span8_t - logical drive definition for 8LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655)  * @lparam	: logical drives parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656)  * @span	: span
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658)  * 8-LD logical drive with up to 8 spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) 	logdrv_param_t	lparam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) 	adap_span_8ld_t	span[SPAN_DEPTH_8_SPANS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) }__attribute__ ((packed)) logdrv_8ld_span8_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667)  * logdrv_8ld_span4_t - logical drive definition for 8LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668)  * @lparam	: logical drives parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)  * @span	: span
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671)  * 8-LD logical drive with up to 4 spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) 	logdrv_param_t	lparam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) 	adap_span_8ld_t	span[SPAN_DEPTH_4_SPANS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) }__attribute__ ((packed)) logdrv_8ld_span4_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680)  * phys_drive_t - physical device information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681)  * @type	: Type of the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682)  * @cur_status	: current status of the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683)  * @tag_depth	: Level of tagging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684)  * @sync_neg	: sync negotiation - ENABLE or DISABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685)  * @size	: configurable size in terms of 512 byte
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) 	uint8_t		type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) 	uint8_t		cur_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) 	uint8_t		tag_depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) 	uint8_t		sync_neg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) 	uint32_t	size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) }__attribute__ ((packed)) phys_drive_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697)  * disk_array_40ld_t - disk array for 40LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698)  * @numldrv	: number of logical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699)  * @resvd	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700)  * @ldrv	: logical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701)  * @pdrv	: physical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) 	uint8_t		numldrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) 	uint8_t		resvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) 	logdrv_40ld_t	ldrv[MAX_LOGICAL_DRIVES_40LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) 	phys_drive_t	pdrv[MBOX_MAX_PHYSICAL_DRIVES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) }__attribute__ ((packed)) disk_array_40ld_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712)  * disk_array_8ld_span8_t - disk array for 8LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713)  * @numldrv	: number of logical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714)  * @resvd	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715)  * @ldrv	: logical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716)  * @pdrv	: physical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718)  * Disk array for 8LD logical drives with up to 8 spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) 	uint8_t			numldrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) 	uint8_t			resvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) 	logdrv_8ld_span8_t	ldrv[MAX_LOGICAL_DRIVES_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) 	phys_drive_t		pdrv[MBOX_MAX_PHYSICAL_DRIVES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) }__attribute__ ((packed)) disk_array_8ld_span8_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729)  * disk_array_8ld_span4_t - disk array for 8LD controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730)  * @numldrv	: number of logical drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731)  * @resvd	:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732)  * @ldrv	: logical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733)  * @pdrv	: physical drives information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735)  * Disk array for 8LD logical drives with up to 4 spans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) 	uint8_t			numldrv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) 	uint8_t			resvd[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) 	logdrv_8ld_span4_t	ldrv[MAX_LOGICAL_DRIVES_8LD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) 	phys_drive_t		pdrv[MBOX_MAX_PHYSICAL_DRIVES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) }__attribute__ ((packed)) disk_array_8ld_span4_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746)  * struct private_bios_data - bios private data for boot devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747)  * @geometry	: bits 0-3 - BIOS geometry, 0x0001 - 1GB, 0x0010 - 2GB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748)  *		0x1000 - 8GB, Others values are invalid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749)  * @unused	: bits 4-7 are unused
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750)  * @boot_drv	: logical drive set as boot drive, 0..7 - for 8LD cards,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751)  * 		0..39 - for 40LD cards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752)  * @cksum	: 0-(sum of first 13 bytes of this structure)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) struct private_bios_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) 	uint8_t		geometry	:4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) 	uint8_t		unused		:4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) 	uint8_t		boot_drv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) 	uint8_t		rsvd[12];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) 	uint16_t	cksum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) } __attribute__ ((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764)  * mbox_sgl64 - 64-bit scatter list for mailbox based controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765)  * @address	: address of the buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766)  * @length	: data transfer length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) 	uint64_t	address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) 	uint32_t	length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) } __attribute__ ((packed)) mbox_sgl64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774)  * mbox_sgl32 - 32-bit scatter list for mailbox based controllers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775)  * @address	: address of the buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776)  * @length	: data transfer length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) 	uint32_t	address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) 	uint32_t	length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) } __attribute__ ((packed)) mbox_sgl32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) #endif		// _MRAID_MBOX_DEFS_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) /* vim: set ts=8 sw=8 tw=78: */