]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - os_freebsd.h
Enhance dh_clean to clean up better
[mirror_smartmontools-debian.git] / os_freebsd.h
index da50231e20c577765d2a1d2dcafaa306e7d75894..a22442f49f56f7fb8f588e1c1883aa5cf3e3d6bd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2003-6 Eduard Martinescu <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 Eduard Martinescu <smartmontools-support@lists.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -11,8 +11,8 @@
  * any later version.
  *
  * You should have received a copy of the GNU General Public License
- * (for example COPYING); if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * (for example COPYING); if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * This code was originally developed as a Senior Thesis by Michael Cornwell
  * at the Concurrent Systems Laboratory (now part of the Storage Systems
 #ifndef OS_FREEBSD_H_
 #define OS_FREEBSD_H_
 
-#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h,v 1.20 2006/04/12 14:54:28 ballen4705 Exp $\n"
+#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 3727 2012-12-13 17:23:06Z samm2 $"
 
-struct freebsd_dev_channel {
-  int   channel;                // the ATA channel to work with
-  int   device;                 // the device on the channel
-  int   atacommand;             // the ATA Command file descriptor (/dev/ata)
-  char* devname;                // the SCSI device name
-  int   unitnum;                // the SCSI unit number
-  int   scsicontrol;            // the SCSI control interface
-};
-
-#define FREEBSD_MAXDEV 64
-#define FREEBSD_FDOFFSET 16;
 #define MAX_NUM_DEV 26
 
 #ifdef  HAVE_SYS_TWEREG_H
@@ -234,8 +223,7 @@ typedef struct
     u_int8_t   sgl_offset:3;
     u_int8_t   size;
     u_int8_t   request_id;
-    u_int8_t   unit:4;
-    u_int8_t   host_id:4;
+    u_int8_t   unit;
     u_int8_t   status;
     u_int8_t   flags;
     u_int16_t  param;
@@ -574,6 +562,58 @@ typedef struct tw_osli_ioctl_with_payload {
 
 #endif
 
+#define HPT_CTL_CODE(x) (x+0xFF00)
+#define HPT_IOCTL_GET_CHANNEL_INFO          HPT_CTL_CODE(3)
+#define HPT_IOCTL_GET_CHANNEL_INFO_V2       HPT_CTL_CODE(53)
+#define HPT_IOCTL_IDE_PASS_THROUGH          HPT_CTL_CODE(24)
+
+#define HPT_READ 1
+#define HPT_WRITE 2
+
+#define HPT_IOCTL_MAGIC   0xA1B2C3D4
+
+#define MAXDEV_PER_CHANNEL 2
+#define PMPORT_PER_CHANNEL 15 /* max devices connected to this channel via pmport */
+
+#pragma pack(1)
+typedef struct _HPT_CHANNEL_INFO {
+  unsigned int reserve1;
+  unsigned int reserve2;
+  unsigned int devices[MAXDEV_PER_CHANNEL];
+} HPT_CHANNEL_INFO, *PHPT_CHANNEL_INFO;
+
+typedef struct _HPT_CHANNEL_INFO_V2 {
+  unsigned int reserve1;
+  unsigned int reserve2;
+  unsigned int devices[PMPORT_PER_CHANNEL];
+} HPT_CHANNEL_INFO_V2, *PHPT_CHANNEL_INFO_V2;
+
+typedef struct _HPT_IOCTL_PARAM {
+  unsigned int magic;     /* used to check if it's a valid ioctl packet */
+  unsigned int ctrl_code; /* operation control code */
+  void* in;               /* input data buffer */
+  unsigned int in_size;   /* size of input data buffer */
+  void* out;              /* output data buffer */
+  unsigned int out_size;  /* size of output data buffer */
+  void* returned_size;    /* count of chars returned */
+} HPT_IOCTL_PARAM, *PHPT_IOCTL_PARAM;
+#define HPT_DO_IOCONTROL       _IOW('H', 0, HPT_IOCTL_PARAM)
+
+typedef struct _HPT_PASS_THROUGH_HEADER {
+  unsigned int id;          /* disk ID */
+  unsigned char feature;
+  unsigned char sectorcount;
+  unsigned char lbalow;
+  unsigned char lbamid;
+  unsigned char lbahigh;
+  unsigned char driverhead;
+  unsigned char command;
+  unsigned char sectors;    /* data size in sectors, if the command has data transfer */
+  unsigned char protocol;   /* HPT_(READ,WRITE) or zero for non-DATA */
+  unsigned char reserve[3];
+}
+HPT_PASS_THROUGH_HEADER, *PHPT_PASS_THROUGH_HEADER;
+#pragma pack()
 
 #ifndef __unused
 #define __unused __attribute__ ((__unused__))