summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp')
-rw-r--r--src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
index 99ff2675a..efa504940 100644
--- a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
@@ -1,4 +1,4 @@
-/* $Id: HostHardwareFreeBSD.cpp $ */
+/* $Id: HostHardwareFreeBSD.cpp 37774 2011-07-04 21:19:27Z vboxsync $ */
/** @file
* Classes for handling hardware detection under FreeBSD.
*/
@@ -35,6 +35,7 @@
#include <iprt/string.h>
#ifdef RT_OS_FREEBSD
+# include <sys/param.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <unistd.h>
@@ -186,11 +187,18 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, bool *pfSuccess)
DeviceMatchPattern.pattern.device_pattern.target_id = CAM_TARGET_WILDCARD;
DeviceMatchPattern.pattern.device_pattern.target_lun = CAM_LUN_WILDCARD;
DeviceMatchPattern.pattern.device_pattern.flags = DEV_MATCH_INQUIRY;
- DeviceMatchPattern.pattern.device_pattern.inq_pat.type = T_CDROM;
- DeviceMatchPattern.pattern.device_pattern.inq_pat.media_type = SIP_MEDIA_REMOVABLE | SIP_MEDIA_FIXED;
- DeviceMatchPattern.pattern.device_pattern.inq_pat.vendor[0] = '*'; /* Matches anything */
- DeviceMatchPattern.pattern.device_pattern.inq_pat.product[0] = '*'; /* Matches anything */
- DeviceMatchPattern.pattern.device_pattern.inq_pat.revision[0] = '*'; /* Matches anything */
+
+#if __FreeBSD_version >= 900000
+# define INQ_PAT data.inq_pat
+#else
+ #define INQ_PAT inq_pat
+#endif
+ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.type = T_CDROM;
+ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.media_type = SIP_MEDIA_REMOVABLE | SIP_MEDIA_FIXED;
+ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.vendor[0] = '*'; /* Matches anything */
+ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.product[0] = '*'; /* Matches anything */
+ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.revision[0] = '*'; /* Matches anything */
+#undef INQ_PAT
DeviceCCB.cdm.num_patterns = 1;
DeviceCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result);
DeviceCCB.cdm.patterns = &DeviceMatchPattern;