72#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 5247 2021-11-23 12:08:56Z samm2 $"
76#ifdef HAVE_SYS_TWEREG_H
77#include <sys/twereg.h>
83#if __FreeBSD_version < 500040
84#define __packed __attribute__((__packed__))
87#define TWE_MAX_SGL_LENGTH 62
88#define TWE_MAX_ATA_SGL_LENGTH 60
89#define TWE_OP_ATA_PASSTHROUGH 0x11
109}
__packed TWE_Command_INITCONNECTION;
137#define TWE_OP_HOTSWAP_REMOVE 0x00
138#define TWE_OP_HOTSWAP_ADD_CBOD 0x01
139#define TWE_OP_HOTSWAP_ADD_SPARE 0x02
154#define TWE_OP_SETATAFEATURE_WCE 0x02
155#define TWE_OP_SETATAFEATURE_DIS_WCE 0x82
159}
__packed TWE_Command_SETATAFEATURE;
199#define TWE_OP_REBUILDUNIT_NOP 0
200#define TWE_OP_REBUILDUNIT_STOP 2
201#define TWE_OP_REBUILDUNIT_START 4
202#define TWE_OP_REBUILDUNIT_STARTUNIT 5
230 u_int8_t sgl_offset:3;
237#define TWE_FLAGS_SUCCESS 0x00
238#define TWE_FLAGS_INFORMATIONAL 0x01
239#define TWE_FLAGS_WARNING 0x02
240#define TWE_FLAGS_FATAL 0x03
241#define TWE_FLAGS_PERCENTAGE (1<<8)
255 TWE_Command_Generic
generic;
273#ifdef HAVE_SYS_TWEIO_H
274#include <sys/tweio.h>
292#define TWEIO_COMMAND _IOWR('T', 100, struct twe_usercommand)
296#ifdef HAVE_SYS_TW_OSL_IOCTL_H
297#include <sys/tw_osl_ioctl.h>
341#define TWA_FW_CMD_ATA_PASSTHROUGH 0x11
343#define TWA_SENSE_DATA_LENGTH 18
531#define TW_OSL_IOCTL_FIRMWARE_PASS_THROUGH \
532 _IOWR('T', 202, TW_OSLI_IOCTL_NO_DATA_BUF)
552#define HPT_CTL_CODE(x) (x+0xFF00)
553#define HPT_IOCTL_GET_CHANNEL_INFO HPT_CTL_CODE(3)
554#define HPT_IOCTL_GET_CHANNEL_INFO_V2 HPT_CTL_CODE(53)
555#define HPT_IOCTL_IDE_PASS_THROUGH HPT_CTL_CODE(24)
560#define HPT_IOCTL_MAGIC 0xA1B2C3D4
562#define MAXDEV_PER_CHANNEL 2
563#define PMPORT_PER_CHANNEL 15
587#define HPT_DO_IOCONTROL _IOW('H', 0, HPT_IOCTL_PARAM)
600 unsigned char reserve[3];
606#define __unused __attribute__ ((__unused__))
611#define MFI_STAT_OK 0x00
612#define MFI_DCMD_PD_GET_LIST 0x02010000
614#define MFI_CTRLR_PREFIX "/dev/mfi"
615#define MRSAS_CTRLR_PREFIX "/dev/mrsas"
620#define MFI_FRAME_POST_IN_REPLY_QUEUE 0x0000
621#define MFI_FRAME_DONT_POST_IN_REPLY_QUEUE 0x0001
622#define MFI_FRAME_SGL32 0x0000
623#define MFI_FRAME_SGL64 0x0002
624#define MFI_FRAME_SENSE32 0x0000
625#define MFI_FRAME_SENSE64 0x0004
626#define MFI_FRAME_DIR_NONE 0x0000
627#define MFI_FRAME_DIR_WRITE 0x0008
628#define MFI_FRAME_DIR_READ 0x0010
629#define MFI_FRAME_DIR_BOTH 0x0018
630#define MFI_FRAME_IEEE_SGL 0x0020
631#define MFI_FRAME_FMT "\20" \
692#define MFI_FRAME_DATAOUT 0x08
693#define MFI_FRAME_DATAIN 0x10
698#define MFI_PASS_FRAME_SIZE 48
707#define MFI_DCMD_FRAME_SIZE 40
708#define MFI_MBOX_SIZE 12
717#define MAX_IOCTL_SGE 16
733#ifdef COMPAT_FREEBSD32
734struct mfi_ioc_packet32 {
735 uint16_t mfi_adapter_no;
737 uint32_t mfi_sgl_off;
738 uint32_t mfi_sge_count;
739 uint32_t mfi_sense_off;
740 uint32_t mfi_sense_len;
760#define MAX_SYS_PDS 240
767#define MFI_CMD _IOWR('M', 1, struct mfi_ioc_packet)
struct megasas_header hdr
struct megasas_pd_address addr[MAX_SYS_PDS]
static struct @44 devices[20]
struct _HPT_PASS_THROUGH_HEADER * PHPT_PASS_THROUGH_HEADER
unsigned long long TW_UINT64
struct _HPT_CHANNEL_INFO_V2 * PHPT_CHANNEL_INFO_V2
struct tw_osli_ioctl_with_payload TW_OSLI_IOCTL_WITH_PAYLOAD
#define TWE_MAX_SGL_LENGTH
struct _HPT_IOCTL_PARAM HPT_IOCTL_PARAM
struct _HPT_CHANNEL_INFO * PHPT_CHANNEL_INFO
#define TWA_SENSE_DATA_LENGTH
struct _HPT_CHANNEL_INFO HPT_CHANNEL_INFO
struct _HPT_CHANNEL_INFO_V2 HPT_CHANNEL_INFO_V2
struct _HPT_IOCTL_PARAM * PHPT_IOCTL_PARAM
#define __packed
The following cut out of twereg.h.
#define MAXDEV_PER_CHANNEL
#define PMPORT_PER_CHANNEL
struct _HPT_PASS_THROUGH_HEADER HPT_PASS_THROUGH_HEADER
struct tw_osli_ioctl_no_data_buf TW_OSLI_IOCTL_NO_DATA_BUF
#define TWE_MAX_ATA_SGL_LENGTH
u_int32_t response_queue_pointer
u_int16_t message_credits
struct mfi_frame_header header
struct mfi_frame_header hdr
struct mfi_frame_header header
uint8_t connect_port_bitmap
TW_UINT16 lun_h4__sgl_entries
TW_UINT16 message_credits
union tw_cl_command_7k cmd_pkt_7k
struct tw_cl_command_header cmd_hdr
struct tw_cl_command_9k cmd_pkt_9k
TW_UINT32 time_remaining_msec
struct tw_cl_driver_packet driver_pkt
struct tw_cl_command_packet cmd_pkt
struct tw_cl_compatibility_packet compat_pkt
struct tw_cl_lock_packet lock_pkt
struct tw_cl_driver_packet driver_pkt
struct tw_cl_event_packet event_pkt
struct tw_cl_command_packet cmd_pkt
TWE_Command_CHECKSTATUS checkstatus
TWE_Command_INITCONNECTION initconnection
TWE_Command_SETATAFEATURE setatafeature
TWE_Command_REBUILDUNIT rebuildunit
struct tw_cl_command_download_firmware download_fw
struct tw_cl_command_param param
struct tw_cl_command_reset_firmware reset_fw
struct tw_cl_command_init_connect init_connect