smartmontools SVN Rev 5611
Utility to control and monitor storage systems with "S.M.A.R.T."
os_freebsd.h
Go to the documentation of this file.
1/*
2 * os_freebsd.h
3 *
4 * Home page of code is: http://www.smartmontools.org
5 *
6 * Copyright (C) 2003-8 Eduard Martinescu
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11/*-
12 * Copyright (c) 2000 Michael Smith
13 * Copyright (c) 2003 Paul Saab
14 * Copyright (c) 2003 Vinod Kashyap
15 * Copyright (c) 2000 BSDi
16 * All rights reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 */
40
41/*
42 * Copyright (c) 2004-05 Applied Micro Circuits Corporation.
43 * Copyright (c) 2004-05 Vinod Kashyap
44 * All rights reserved.
45 *
46 * Redistribution and use in source and binary forms, with or without
47 * modification, are permitted provided that the following conditions
48 * are met:
49 * 1. Redistributions of source code must retain the above copyright
50 * notice, this list of conditions and the following disclaimer.
51 * 2. Redistributions in binary form must reproduce the above copyright
52 * notice, this list of conditions and the following disclaimer in the
53 * documentation and/or other materials provided with the distribution.
54 *
55 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
56 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
59 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65 * SUCH DAMAGE.
66 *
67 */
68
69#ifndef OS_FREEBSD_H_
70#define OS_FREEBSD_H_
71
72#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 5247 2021-11-23 12:08:56Z samm2 $"
73
74#define MAX_NUM_DEV 26
75
76#ifdef HAVE_SYS_TWEREG_H
77#include <sys/twereg.h>
78#else
79/**
80 * The following cut out of twereg.h
81 *
82 */
83#if __FreeBSD_version < 500040
84#define __packed __attribute__((__packed__))
85#endif
86
87#define TWE_MAX_SGL_LENGTH 62
88#define TWE_MAX_ATA_SGL_LENGTH 60
89#define TWE_OP_ATA_PASSTHROUGH 0x11
90
91/* scatter/gather list entry */
92typedef struct
93{
94 u_int32_t address;
95 u_int32_t length;
96} __packed TWE_SG_Entry;
97
98typedef struct {
99 u_int8_t opcode:5; /* TWE_OP_INITCONNECTION */
100 u_int8_t res1:3;
101 u_int8_t size;
102 u_int8_t request_id;
103 u_int8_t res2:4;
104 u_int8_t host_id:4;
105 u_int8_t status;
106 u_int8_t flags;
109} __packed TWE_Command_INITCONNECTION;
110
111typedef struct
112{
113 u_int8_t opcode:5; /* TWE_OP_READ/TWE_OP_WRITE */
114 u_int8_t res1:3;
115 u_int8_t size;
116 u_int8_t request_id;
117 u_int8_t unit:4;
118 u_int8_t host_id:4;
119 u_int8_t status;
120 u_int8_t flags;
121 u_int16_t block_count;
122 u_int32_t lba;
123 TWE_SG_Entry sgl[TWE_MAX_SGL_LENGTH];
124} __packed TWE_Command_IO;
125
126typedef struct
127{
128 u_int8_t opcode:5; /* TWE_OP_HOTSWAP */
129 u_int8_t res1:3;
130 u_int8_t size;
131 u_int8_t request_id;
132 u_int8_t unit:4;
133 u_int8_t host_id:4;
134 u_int8_t status;
135 u_int8_t flags;
136 u_int8_t action;
137#define TWE_OP_HOTSWAP_REMOVE 0x00 /* remove assumed-degraded unit */
138#define TWE_OP_HOTSWAP_ADD_CBOD 0x01 /* add CBOD to empty port */
139#define TWE_OP_HOTSWAP_ADD_SPARE 0x02 /* add spare to empty port */
140 u_int8_t aport;
141} __packed TWE_Command_HOTSWAP;
142
143typedef struct
144{
145 u_int8_t opcode:5; /* TWE_OP_SETATAFEATURE */
146 u_int8_t res1:3;
147 u_int8_t size;
148 u_int8_t request_id;
149 u_int8_t unit:4;
150 u_int8_t host_id:4;
151 u_int8_t status;
152 u_int8_t flags;
153 u_int8_t feature;
154#define TWE_OP_SETATAFEATURE_WCE 0x02
155#define TWE_OP_SETATAFEATURE_DIS_WCE 0x82
156 u_int8_t feature_mode;
157 u_int16_t all_units;
158 u_int16_t persistence;
159} __packed TWE_Command_SETATAFEATURE;
160
161typedef struct
162{
163 u_int8_t opcode:5; /* TWE_OP_CHECKSTATUS */
164 u_int8_t res1:3;
165 u_int8_t size;
166 u_int8_t request_id;
167 u_int8_t unit:4;
168 u_int8_t res2:4;
169 u_int8_t status;
170 u_int8_t flags;
171 u_int16_t target_status; /* set low byte to target request's ID */
172} __packed TWE_Command_CHECKSTATUS;
173
174typedef struct
175{
176 u_int8_t opcode:5; /* TWE_OP_GETPARAM, TWE_OP_SETPARAM */
177 u_int8_t res1:3;
178 u_int8_t size;
179 u_int8_t request_id;
180 u_int8_t unit:4;
181 u_int8_t host_id:4;
182 u_int8_t status;
183 u_int8_t flags;
184 u_int16_t param_count;
185 TWE_SG_Entry sgl[TWE_MAX_SGL_LENGTH];
186} __packed TWE_Command_PARAM;
187
188typedef struct
189{
190 u_int8_t opcode:5; /* TWE_OP_REBUILDUNIT */
191 u_int8_t res1:3;
192 u_int8_t size;
193 u_int8_t request_id;
194 u_int8_t src_unit:4;
195 u_int8_t host_id:4;
196 u_int8_t status;
197 u_int8_t flags;
198 u_int8_t action:7;
199#define TWE_OP_REBUILDUNIT_NOP 0
200#define TWE_OP_REBUILDUNIT_STOP 2 /* stop all rebuilds */
201#define TWE_OP_REBUILDUNIT_START 4 /* start rebuild with lowest unit */
202#define TWE_OP_REBUILDUNIT_STARTUNIT 5 /* rebuild src_unit (not supported) */
203 u_int8_t cs:1; /* request state change on src_unit */
204 u_int8_t logical_subunit; /* for RAID10 rebuild of logical subunit */
205} __packed TWE_Command_REBUILDUNIT;
206
207typedef struct
208{
209 u_int8_t opcode:5;
210 u_int8_t sgl_offset:3;
211 u_int8_t size;
212 u_int8_t request_id;
213 u_int8_t unit;
214 u_int8_t status;
215 u_int8_t flags;
216 u_int16_t param;
217 u_int16_t features;
218 u_int16_t sector_count;
219 u_int16_t sector_num;
220 u_int16_t cylinder_lo;
221 u_int16_t cylinder_hi;
222 u_int8_t drive_head;
223 u_int8_t command;
224 TWE_SG_Entry sgl[TWE_MAX_ATA_SGL_LENGTH];
225} __packed TWE_Command_ATA;
226
227typedef struct
228{
229 u_int8_t opcode:5;
230 u_int8_t sgl_offset:3;
231 u_int8_t size;
232 u_int8_t request_id;
233 u_int8_t unit:4;
234 u_int8_t host_id:4;
235 u_int8_t status;
236 u_int8_t flags;
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) /* bits 0-6 indicate completion percentage */
242 u_int16_t count; /* block count, parameter count, message credits */
243} __packed TWE_Command_Generic;
244
245/* command packet - must be TWE_ALIGNMENT aligned */
246typedef union
247{
248 TWE_Command_INITCONNECTION initconnection;
249 TWE_Command_IO io;
250 TWE_Command_PARAM param;
251 TWE_Command_CHECKSTATUS checkstatus;
252 TWE_Command_REBUILDUNIT rebuildunit;
253 TWE_Command_SETATAFEATURE setatafeature;
254 TWE_Command_ATA ata;
255 TWE_Command_Generic generic;
256 u_int8_t pad[512];
258
259/* response queue entry */
260typedef union
261{
262 struct
263 {
264 u_int32_t undefined_1:4;
265 u_int32_t response_id:8;
266 u_int32_t undefined_2:20;
267 } u;
268 u_int32_t value;
270
271#endif
272
273#ifdef HAVE_SYS_TWEIO_H
274#include <sys/tweio.h>
275#else
276/*
277 * Following cut out of tweio.h
278 *
279 */
280/*
281 * User-space command
282 *
283 * Note that the command's scatter/gather list will be computed by the
284 * driver, and cannot be filled in by the consumer.
285 */
287 TWE_Command tu_command; /* command ready for the controller */
288 void *tu_data; /* pointer to data in userspace */
289 size_t tu_size; /* userspace data length */
290};
291
292#define TWEIO_COMMAND _IOWR('T', 100, struct twe_usercommand)
293
294#endif
295
296#ifdef HAVE_SYS_TW_OSL_IOCTL_H
297#include <sys/tw_osl_ioctl.h>
298#else
299/*
300 * Following cut out of tw_osl_types.h
301 *
302 */
303
304typedef void TW_VOID;
305typedef char TW_INT8;
306typedef unsigned char TW_UINT8;
307typedef short TW_INT16;
308typedef unsigned short TW_UINT16;
309typedef int TW_INT32;
310typedef unsigned int TW_UINT32;
311typedef long long TW_INT64;
312typedef unsigned long long TW_UINT64;
313
314/*
315 * Following cut out of tw_cl_share.h
316 *
317 */
318
319#pragma pack(1)
320
329 TW_UINT8 parameter_data[98];
331 TW_UINT8 severity_str[20];
332};
333
334#pragma pack()
335
336/*
337 * Following cut out of tw_cl_fwif.h
338 *
339 */
340
341#define TWA_FW_CMD_ATA_PASSTHROUGH 0x11
342
343#define TWA_SENSE_DATA_LENGTH 18
344
345#pragma pack(1)
346/* 7000 structures. */
361};
362
363
364/* Structure for downloading firmware onto the controller. */
374};
375
376
377/* Structure for hard resetting the controller. */
387};
388
389
390/* Structure for sending get/set param commands. */
400};
401
402
403/* Generic command packet. */
411 TW_UINT16 count; /* block cnt, parameter cnt, message credits */
412};
413
414
415/* Command packet header. */
418 struct {
419 TW_INT8 reserved[4];
423 } status_block;
424 TW_UINT8 err_specific_desc[98];
425 struct {
429 } header_desc;
430};
431
432
433/* 7000 Command packet. */
439 struct tw_cl_command_generic generic;
440 TW_UINT8 padding[1024 - sizeof(struct tw_cl_command_header)];
441};
442
443
444/* 9000 Command Packet. */
450 TW_UINT8 sgl_offset; /* offset (in bytes) to sg_list, from the
451 end of sgl_entries */
454 TW_UINT8 sg_list[872];/* total struct size =
455 1024-sizeof(cmd_hdr) */
456};
457
458
459/* Full command packet. */
462 union {
465 } command;
466};
467
468#pragma pack()
469
470/*
471 * Following cut out of tw_cl_ioctl.h
472 *
473 */
474
475#pragma pack(1)
476
477/* Structure used to handle GET/RELEASE LOCK ioctls. */
482};
483
484
485/* Structure used to handle GET COMPATIBILITY INFO ioctl. */
487 TW_UINT8 driver_version[32];/* driver version */
488 TW_UINT16 working_srl; /* driver & firmware negotiated srl */
489 TW_UINT16 working_branch; /* branch # of the firmware that the
490 driver is compatible with */
491 TW_UINT16 working_build; /* build # of the firmware that the
492 driver is compatible with */
493};
494
495
496/* Driver understandable part of the ioctl packet built by the API. */
504};
505
506#pragma pack()
507
508/*
509 * Following cut out of tw_osl_ioctl.h
510 *
511 */
512
513#pragma pack(1)
514/*
515 * We need the structure below to ensure that the first byte of
516 * data_buf is not overwritten by the kernel, after we return
517 * from the ioctl call. Note that cmd_pkt has been reduced
518 * to an array of 1024 bytes even though it's actually 2048 bytes
519 * in size. This is because, we don't expect requests from user
520 * land requiring 2048 (273 sg elements) byte cmd pkts.
521 */
524 TW_VOID *pdata; /* points to data_buf */
525 TW_INT8 padding[488 - sizeof(TW_VOID *)];
528
529#pragma pack()
530
531#define TW_OSL_IOCTL_FIRMWARE_PASS_THROUGH \
532 _IOWR('T', 202, TW_OSLI_IOCTL_NO_DATA_BUF)
533
534#pragma pack(1)
535
538 TW_INT8 padding[488];
540 union {
544 TW_INT8 data_buf[1];
545 } payload;
547
548#pragma pack()
549
550#endif
551
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)
556
557#define HPT_READ 1
558#define HPT_WRITE 2
559
560#define HPT_IOCTL_MAGIC 0xA1B2C3D4
561
562#define MAXDEV_PER_CHANNEL 2
563#define PMPORT_PER_CHANNEL 15 /* max devices connected to this channel via pmport */
564
565#pragma pack(1)
566typedef struct _HPT_CHANNEL_INFO {
567 unsigned int reserve1;
568 unsigned int reserve2;
571
572typedef struct _HPT_CHANNEL_INFO_V2 {
573 unsigned int reserve1;
574 unsigned int reserve2;
577
578typedef struct _HPT_IOCTL_PARAM {
579 unsigned int magic; /* used to check if it's a valid ioctl packet */
580 unsigned int ctrl_code; /* operation control code */
581 void* in; /* input data buffer */
582 unsigned int in_size; /* size of input data buffer */
583 void* out; /* output data buffer */
584 unsigned int out_size; /* size of output data buffer */
585 void* returned_size; /* count of chars returned */
587#define HPT_DO_IOCONTROL _IOW('H', 0, HPT_IOCTL_PARAM)
588
590 unsigned int id; /* disk ID */
591 unsigned char feature;
592 unsigned char sectorcount;
593 unsigned char lbalow;
594 unsigned char lbamid;
595 unsigned char lbahigh;
596 unsigned char driverhead;
597 unsigned char command;
598 unsigned char sectors; /* data size in sectors, if the command has data transfer */
599 unsigned char protocol; /* HPT_(READ,WRITE) or zero for non-DATA */
600 unsigned char reserve[3];
601}
603#pragma pack()
604
605#ifndef __unused
606#define __unused __attribute__ ((__unused__))
607#endif
608
609// MFI definition from the kernel sources, see sys/dev/mfi
610
611#define MFI_STAT_OK 0x00
612#define MFI_DCMD_PD_GET_LIST 0x02010000
613
614#define MFI_CTRLR_PREFIX "/dev/mfi"
615#define MRSAS_CTRLR_PREFIX "/dev/mrsas"
616
617/*
618 * MFI Frame flags
619 */
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" \
632 "\1NOPOST" \
633 "\2SGL64" \
634 "\3SENSE64" \
635 "\4WRITE" \
636 "\5READ" \
637 "\6IEEESGL"
638
639/* MFI Commands */
640typedef enum {
651
652/* Scatter Gather elements */
653struct mfi_sg32 {
654 uint32_t addr;
655 uint32_t len;
657
658struct mfi_sg64 {
659 uint64_t addr;
660 uint32_t len;
661} __packed;
662
664 uint64_t addr;
665 uint32_t len;
666 uint32_t flag;
667} __packed;
668
669union mfi_sgl {
670 struct mfi_sg32 sg32[1];
671 struct mfi_sg64 sg64[1];
672 struct mfi_sg_skinny sg_skinny[1];
673} __packed;
674
675/* Message frames. All messages have a common header */
677 uint8_t cmd;
678 uint8_t sense_len;
679 uint8_t cmd_status;
680 uint8_t scsi_status;
681 uint8_t target_id;
682 uint8_t lun_id;
683 uint8_t cdb_len;
684 uint8_t sg_count;
685 uint32_t context;
686 /*
687 * pad0 is MSI Specific. Not used by Driver. Zero the value before
688 * sending the command to f/w.
689 */
690 uint32_t pad0;
691 uint16_t flags;
692#define MFI_FRAME_DATAOUT 0x08
693#define MFI_FRAME_DATAIN 0x10
694 uint16_t timeout;
695 uint32_t data_len;
696} __packed;
697
698#define MFI_PASS_FRAME_SIZE 48
703 uint8_t cdb[16];
705} __packed;
706
707#define MFI_DCMD_FRAME_SIZE 40
708#define MFI_MBOX_SIZE 12
709
712 uint32_t opcode;
715} __packed;
716
717#define MAX_IOCTL_SGE 16
720 uint16_t mfi_pad1;
721 uint32_t mfi_sgl_off;
725 union {
726 uint8_t raw[128];
728 } mfi_frame;
729
730 struct iovec mfi_sgl[MAX_IOCTL_SGE];
731} __packed;
732
733#ifdef COMPAT_FREEBSD32
734struct mfi_ioc_packet32 {
735 uint16_t mfi_adapter_no;
736 uint16_t mfi_pad1;
737 uint32_t mfi_sgl_off;
738 uint32_t mfi_sge_count;
739 uint32_t mfi_sense_off;
740 uint32_t mfi_sense_len;
741 union {
742 uint8_t raw[128];
743 struct mfi_frame_header hdr;
744 } mfi_frame;
745
746 struct iovec32 mfi_sgl[MAX_IOCTL_SGE];
747} __packed;
748#endif
749
751 uint16_t device_id;
753 uint8_t encl_index;
754 uint8_t slot_number;
755 uint8_t scsi_dev_type; /* 0 = disk */
757 uint64_t sas_addr[2];
758} __packed;
759
760#define MAX_SYS_PDS 240
762 uint32_t size;
763 uint32_t count;
765} __packed;
766
767#define MFI_CMD _IOWR('M', 1, struct mfi_ioc_packet)
768
769#endif /* OS_FREEBSD_H_ */
u16 flags
Definition: megaraid.h:14
uint8_t opcode
Definition: megaraid.h:0
u8 raw[128]
Definition: megaraid.h:7
struct megasas_header hdr
Definition: megaraid.h:8
u8 cdb[16]
Definition: megaraid.h:21
struct megasas_pd_address addr[MAX_SYS_PDS]
Definition: megaraid.h:2
union megasas_sgl sgl
Definition: megaraid.h:22
megacmd_t mbox
Definition: megaraid.h:13
u32 size
Definition: megaraid.h:0
u64 sas_addr[2]
Definition: megaraid.h:6
static struct @44 devices[20]
struct _HPT_PASS_THROUGH_HEADER * PHPT_PASS_THROUGH_HEADER
#define MAX_IOCTL_SGE
Definition: os_freebsd.h:717
#define MAX_SYS_PDS
Definition: os_freebsd.h:760
unsigned short TW_UINT16
Definition: os_freebsd.h:308
unsigned long long TW_UINT64
Definition: os_freebsd.h:312
struct _HPT_CHANNEL_INFO_V2 * PHPT_CHANNEL_INFO_V2
mfi_cmd_t
Definition: os_freebsd.h:640
@ MFI_CMD_INIT
Definition: os_freebsd.h:641
@ MFI_CMD_STP
Definition: os_freebsd.h:649
@ MFI_CMD_PD_SCSI_IO
Definition: os_freebsd.h:645
@ MFI_CMD_LD_SCSI_IO
Definition: os_freebsd.h:644
@ MFI_CMD_LD_WRITE
Definition: os_freebsd.h:643
@ MFI_CMD_LD_READ
Definition: os_freebsd.h:642
@ MFI_CMD_SMP
Definition: os_freebsd.h:648
@ MFI_CMD_DCMD
Definition: os_freebsd.h:646
@ MFI_CMD_ABORT
Definition: os_freebsd.h:647
int TW_INT32
Definition: os_freebsd.h:309
struct tw_osli_ioctl_with_payload TW_OSLI_IOCTL_WITH_PAYLOAD
#define TWE_MAX_SGL_LENGTH
Definition: os_freebsd.h:87
struct _HPT_IOCTL_PARAM HPT_IOCTL_PARAM
struct _HPT_CHANNEL_INFO * PHPT_CHANNEL_INFO
#define TWA_SENSE_DATA_LENGTH
Definition: os_freebsd.h:343
struct _HPT_CHANNEL_INFO HPT_CHANNEL_INFO
short TW_INT16
Definition: os_freebsd.h:307
struct _HPT_CHANNEL_INFO_V2 HPT_CHANNEL_INFO_V2
long long TW_INT64
Definition: os_freebsd.h:311
struct _HPT_IOCTL_PARAM * PHPT_IOCTL_PARAM
#define __packed
The following cut out of twereg.h.
Definition: os_freebsd.h:84
char TW_INT8
Definition: os_freebsd.h:305
#define MAXDEV_PER_CHANNEL
Definition: os_freebsd.h:562
#define PMPORT_PER_CHANNEL
Definition: os_freebsd.h:563
unsigned int TW_UINT32
Definition: os_freebsd.h:310
struct _HPT_PASS_THROUGH_HEADER HPT_PASS_THROUGH_HEADER
unsigned char TW_UINT8
Definition: os_freebsd.h:306
struct tw_osli_ioctl_no_data_buf TW_OSLI_IOCTL_NO_DATA_BUF
void TW_VOID
Definition: os_freebsd.h:304
#define TWE_MAX_ATA_SGL_LENGTH
Definition: os_freebsd.h:88
#define MFI_MBOX_SIZE
Definition: os_freebsd.h:708
unsigned int reserve1
Definition: os_freebsd.h:573
unsigned int reserve2
Definition: os_freebsd.h:574
unsigned int reserve2
Definition: os_freebsd.h:568
unsigned int reserve1
Definition: os_freebsd.h:567
unsigned int magic
Definition: os_freebsd.h:579
unsigned int ctrl_code
Definition: os_freebsd.h:580
unsigned int out_size
Definition: os_freebsd.h:584
void * returned_size
Definition: os_freebsd.h:585
unsigned int in_size
Definition: os_freebsd.h:582
unsigned char protocol
Definition: os_freebsd.h:599
unsigned char sectors
Definition: os_freebsd.h:598
unsigned char lbalow
Definition: os_freebsd.h:593
unsigned char lbahigh
Definition: os_freebsd.h:595
unsigned char sectorcount
Definition: os_freebsd.h:592
unsigned char feature
Definition: os_freebsd.h:591
unsigned char command
Definition: os_freebsd.h:597
unsigned char lbamid
Definition: os_freebsd.h:594
unsigned char driverhead
Definition: os_freebsd.h:596
u_int16_t param
Definition: os_freebsd.h:216
u_int16_t block_count
Definition: os_freebsd.h:121
u_int16_t cylinder_lo
Definition: os_freebsd.h:220
u_int32_t length
Definition: os_freebsd.h:95
u_int8_t size
Definition: os_freebsd.h:101
u_int8_t logical_subunit
Definition: os_freebsd.h:204
u_int8_t opcode
Definition: os_freebsd.h:99
u_int8_t res2
Definition: os_freebsd.h:103
u_int8_t unit
Definition: os_freebsd.h:117
u_int8_t src_unit
Definition: os_freebsd.h:194
u_int8_t feature
Definition: os_freebsd.h:153
u_int32_t address
Definition: os_freebsd.h:94
u_int8_t res1
Definition: os_freebsd.h:100
u_int8_t aport
Definition: os_freebsd.h:140
u_int8_t drive_head
Definition: os_freebsd.h:222
u_int16_t cylinder_hi
Definition: os_freebsd.h:221
u_int32_t response_queue_pointer
Definition: os_freebsd.h:108
u_int16_t all_units
Definition: os_freebsd.h:157
u_int8_t host_id
Definition: os_freebsd.h:104
u_int16_t count
Definition: os_freebsd.h:242
u_int16_t sector_num
Definition: os_freebsd.h:219
u_int8_t feature_mode
Definition: os_freebsd.h:156
u_int8_t command
Definition: os_freebsd.h:223
u_int16_t persistence
Definition: os_freebsd.h:158
u_int8_t cs
Definition: os_freebsd.h:203
u_int16_t sector_count
Definition: os_freebsd.h:218
u_int8_t action
Definition: os_freebsd.h:136
u_int8_t request_id
Definition: os_freebsd.h:102
u_int8_t sgl_offset
Definition: os_freebsd.h:210
u_int32_t lba
Definition: os_freebsd.h:122
u_int8_t flags
Definition: os_freebsd.h:106
u_int16_t target_status
Definition: os_freebsd.h:171
u_int16_t features
Definition: os_freebsd.h:217
u_int8_t status
Definition: os_freebsd.h:105
u_int16_t param_count
Definition: os_freebsd.h:184
u_int16_t message_credits
Definition: os_freebsd.h:107
uint32_t opcode
Definition: os_freebsd.h:712
union mfi_sgl sgl
Definition: os_freebsd.h:714
struct mfi_frame_header header
Definition: os_freebsd.h:711
uint32_t data_len
Definition: os_freebsd.h:695
uint8_t sg_count
Definition: os_freebsd.h:684
uint8_t sense_len
Definition: os_freebsd.h:678
uint8_t cmd_status
Definition: os_freebsd.h:679
uint8_t scsi_status
Definition: os_freebsd.h:680
uint16_t flags
Definition: os_freebsd.h:691
uint8_t target_id
Definition: os_freebsd.h:681
uint16_t timeout
Definition: os_freebsd.h:694
uint32_t context
Definition: os_freebsd.h:685
struct mfi_frame_header hdr
Definition: os_freebsd.h:727
uint16_t mfi_pad1
Definition: os_freebsd.h:720
uint32_t mfi_sge_count
Definition: os_freebsd.h:722
uint32_t mfi_sense_off
Definition: os_freebsd.h:723
uint32_t mfi_sgl_off
Definition: os_freebsd.h:721
uint32_t mfi_sense_len
Definition: os_freebsd.h:724
uint16_t mfi_adapter_no
Definition: os_freebsd.h:719
uint32_t sense_addr_lo
Definition: os_freebsd.h:701
struct mfi_frame_header header
Definition: os_freebsd.h:700
union mfi_sgl sgl
Definition: os_freebsd.h:704
uint32_t sense_addr_hi
Definition: os_freebsd.h:702
uint8_t slot_number
Definition: os_freebsd.h:754
uint16_t encl_device_id
Definition: os_freebsd.h:752
uint8_t scsi_dev_type
Definition: os_freebsd.h:755
uint16_t device_id
Definition: os_freebsd.h:751
uint8_t encl_index
Definition: os_freebsd.h:753
uint8_t connect_port_bitmap
Definition: os_freebsd.h:756
uint32_t count
Definition: os_freebsd.h:763
uint32_t size
Definition: os_freebsd.h:762
uint32_t len
Definition: os_freebsd.h:655
uint32_t addr
Definition: os_freebsd.h:654
uint64_t addr
Definition: os_freebsd.h:659
uint32_t len
Definition: os_freebsd.h:660
uint64_t addr
Definition: os_freebsd.h:664
uint32_t flag
Definition: os_freebsd.h:666
uint32_t len
Definition: os_freebsd.h:665
TW_UINT8 res__opcode
Definition: os_freebsd.h:446
TW_UINT16 lun_l4__req_id
Definition: os_freebsd.h:448
TW_UINT16 lun_h4__sgl_entries
Definition: os_freebsd.h:452
TW_UINT8 sgl_offset
Definition: os_freebsd.h:450
TW_UINT8 status
Definition: os_freebsd.h:449
TW_UINT8 sgl_off__opcode
Definition: os_freebsd.h:405
TW_UINT8 res__severity
Definition: os_freebsd.h:422
union tw_cl_command_7k cmd_pkt_7k
Definition: os_freebsd.h:463
struct tw_cl_command_header cmd_hdr
Definition: os_freebsd.h:461
struct tw_cl_command_9k cmd_pkt_9k
Definition: os_freebsd.h:464
TW_UINT16 param_count
Definition: os_freebsd.h:398
TW_UINT8 sgl_off__opcode
Definition: os_freebsd.h:392
TW_UINT8 host_id__unit
Definition: os_freebsd.h:395
TW_UINT32 unique_id
Definition: os_freebsd.h:500
TW_UINT32 os_status
Definition: os_freebsd.h:502
TW_UINT32 buffer_length
Definition: os_freebsd.h:503
TW_UINT32 sequence_id
Definition: os_freebsd.h:501
TW_UINT32 control_code
Definition: os_freebsd.h:498
TW_UINT8 repeat_count
Definition: os_freebsd.h:327
TW_UINT8 parameter_len
Definition: os_freebsd.h:328
TW_UINT32 event_src
Definition: os_freebsd.h:330
TW_UINT16 aen_code
Definition: os_freebsd.h:324
TW_UINT8 retrieved
Definition: os_freebsd.h:326
TW_UINT32 time_stamp_sec
Definition: os_freebsd.h:323
TW_UINT32 sequence_id
Definition: os_freebsd.h:322
TW_UINT32 timeout_msec
Definition: os_freebsd.h:479
TW_UINT32 time_remaining_msec
Definition: os_freebsd.h:480
TW_UINT32 force_flag
Definition: os_freebsd.h:481
struct tw_cl_driver_packet driver_pkt
Definition: os_freebsd.h:523
struct tw_cl_command_packet cmd_pkt
Definition: os_freebsd.h:526
struct tw_cl_compatibility_packet compat_pkt
Definition: os_freebsd.h:543
struct tw_cl_lock_packet lock_pkt
Definition: os_freebsd.h:542
struct tw_cl_driver_packet driver_pkt
Definition: os_freebsd.h:537
struct tw_cl_event_packet event_pkt
Definition: os_freebsd.h:541
struct tw_cl_command_packet cmd_pkt
Definition: os_freebsd.h:539
TWE_Command tu_command
Definition: os_freebsd.h:287
TWE_Command_CHECKSTATUS checkstatus
Definition: os_freebsd.h:251
TWE_Command_IO io
Definition: os_freebsd.h:249
TWE_Command_PARAM param
Definition: os_freebsd.h:250
TWE_Command_ATA ata
Definition: os_freebsd.h:254
TWE_Command_INITCONNECTION initconnection
Definition: os_freebsd.h:248
TWE_Command_SETATAFEATURE setatafeature
Definition: os_freebsd.h:253
TWE_Command_REBUILDUNIT rebuildunit
Definition: os_freebsd.h:252
u_int32_t undefined_1
Definition: os_freebsd.h:264
u_int32_t undefined_2
Definition: os_freebsd.h:266
u_int32_t response_id
Definition: os_freebsd.h:265
struct tw_cl_command_download_firmware download_fw
Definition: os_freebsd.h:436
struct tw_cl_command_param param
Definition: os_freebsd.h:438
struct tw_cl_command_reset_firmware reset_fw
Definition: os_freebsd.h:437
struct tw_cl_command_init_connect init_connect
Definition: os_freebsd.h:435