* Add support for usb2 in -CURRENT.
* Fix processing of devd events. * Add support for the PART GEOM type. * Attempt to fix a race condition where a drive an be learned before its parent. This fix only works on 7.1, RELENG_7, and -CURRENT.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= hal
|
||||
DISTVERSION= 0.5.11
|
||||
PORTREVISION= 17
|
||||
PORTREVISION= 18
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= http://hal.freedesktop.org/releases/
|
||||
|
||||
|
||||
12
sysutils/hal/files/patch-config.h.in
Normal file
12
sysutils/hal/files/patch-config.h.in
Normal file
@@ -0,0 +1,12 @@
|
||||
--- config.h.in.orig 2009-02-17 23:52:07.000000000 -0500
|
||||
+++ config.h.in 2009-02-17 23:52:41.000000000 -0500
|
||||
@@ -61,6 +61,9 @@
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
+/* Set if we need libusb20 */
|
||||
+#undef HAVE_LIBUSB20
|
||||
+
|
||||
/* Define to 1 if you have the `uuid' library (-luuid). */
|
||||
#undef HAVE_LIBUUID
|
||||
|
||||
328
sysutils/hal/files/patch-configure
Normal file
328
sysutils/hal/files/patch-configure
Normal file
@@ -0,0 +1,328 @@
|
||||
--- configure.orig 2009-02-23 01:57:48.000000000 -0500
|
||||
+++ configure 2009-02-23 01:57:54.000000000 -0500
|
||||
@@ -930,6 +930,8 @@ HALD_COMPILE_FREEBSD_FALSE
|
||||
HALD_COMPILE_SOLARIS_TRUE
|
||||
HALD_COMPILE_SOLARIS_FALSE
|
||||
HALD_BACKEND
|
||||
+HAVE_LIBUSB20_TRUE
|
||||
+HAVE_LIBUSB20_FALSE
|
||||
HAVE_CONKIT_TRUE
|
||||
HAVE_CONKIT_FALSE
|
||||
GPERF
|
||||
@@ -5944,7 +5946,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
- echo '#line 5947 "configure"' > conftest.$ac_ext
|
||||
+ echo '#line 5949 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@@ -8596,11 +8598,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:8599: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:8601: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:8603: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:8605: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -8886,11 +8888,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:8889: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:8891: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:8893: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:8895: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -8990,11 +8992,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:8993: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:8995: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
- echo "$as_me:8997: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:8999: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -11354,7 +11356,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
-#line 11357 "configure"
|
||||
+#line 11359 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11454,7 +11456,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
-#line 11457 "configure"
|
||||
+#line 11459 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -13855,11 +13857,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:13858: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:13860: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:13862: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:13864: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -13959,11 +13961,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:13962: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:13964: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
- echo "$as_me:13966: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:13968: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -15542,11 +15544,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:15545: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:15547: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:15549: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:15551: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -15646,11 +15648,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:15649: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:15651: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
- echo "$as_me:15653: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:15655: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -17853,11 +17855,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:17856: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:17858: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:17860: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:17862: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -18143,11 +18145,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:18146: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:18148: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
- echo "$as_me:18150: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:18152: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -18247,11 +18249,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
- (eval echo "\"\$as_me:18250: $lt_compile\"" >&5)
|
||||
+ (eval echo "\"\$as_me:18252: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
- echo "$as_me:18254: \$? = $ac_status" >&5
|
||||
+ echo "$as_me:18256: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -23420,6 +23422,7 @@ else
|
||||
fi
|
||||
|
||||
|
||||
+USE_LIBUSB20=no
|
||||
|
||||
# Check whether --with-backend was given.
|
||||
if test "${with_backend+set}" = set; then
|
||||
@@ -23477,6 +23480,91 @@ else
|
||||
fi
|
||||
|
||||
|
||||
+if test "x$HALD_BACKEND" = "xfreebsd"; then
|
||||
+ { echo "$as_me:$LINENO: checking for libusb20_dev_get_info in -lusb20" >&5
|
||||
+echo $ECHO_N "checking for libusb20_dev_get_info in -lusb20... $ECHO_C" >&6; }
|
||||
+if test "${ac_cv_lib_usb20_libusb20_dev_get_info+set}" = set; then
|
||||
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
+else
|
||||
+ ac_check_lib_save_LIBS=$LIBS
|
||||
+LIBS="-lusb20 $LIBS"
|
||||
+cat >conftest.$ac_ext <<_ACEOF
|
||||
+/* confdefs.h. */
|
||||
+_ACEOF
|
||||
+cat confdefs.h >>conftest.$ac_ext
|
||||
+cat >>conftest.$ac_ext <<_ACEOF
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char libusb20_dev_get_info ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return libusb20_dev_get_info ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
+if { (ac_try="$ac_link"
|
||||
+case "(($ac_try" in
|
||||
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
+ *) ac_try_echo=$ac_try;;
|
||||
+esac
|
||||
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
+ (eval "$ac_link") 2>conftest.er1
|
||||
+ ac_status=$?
|
||||
+ grep -v '^ *+' conftest.er1 >conftest.err
|
||||
+ rm -f conftest.er1
|
||||
+ cat conftest.err >&5
|
||||
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
+ (exit $ac_status); } && {
|
||||
+ test -z "$ac_c_werror_flag" ||
|
||||
+ test ! -s conftest.err
|
||||
+ } && test -s conftest$ac_exeext &&
|
||||
+ $as_test_x conftest$ac_exeext; then
|
||||
+ ac_cv_lib_usb20_libusb20_dev_get_info=yes
|
||||
+else
|
||||
+ echo "$as_me: failed program was:" >&5
|
||||
+sed 's/^/| /' conftest.$ac_ext >&5
|
||||
+
|
||||
+ ac_cv_lib_usb20_libusb20_dev_get_info=no
|
||||
+fi
|
||||
+
|
||||
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+LIBS=$ac_check_lib_save_LIBS
|
||||
+fi
|
||||
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb20_libusb20_dev_get_info" >&5
|
||||
+echo "${ECHO_T}$ac_cv_lib_usb20_libusb20_dev_get_info" >&6; }
|
||||
+if test $ac_cv_lib_usb20_libusb20_dev_get_info = yes; then
|
||||
+ USE_LIBUSB20=yes
|
||||
+else
|
||||
+ USE_LIBUSB20=no
|
||||
+fi
|
||||
+
|
||||
+fi
|
||||
+ if test "x$USE_LIBUSB20" = "xyes"; then
|
||||
+ HAVE_LIBUSB20_TRUE=
|
||||
+ HAVE_LIBUSB20_FALSE='#'
|
||||
+else
|
||||
+ HAVE_LIBUSB20_TRUE='#'
|
||||
+ HAVE_LIBUSB20_FALSE=
|
||||
+fi
|
||||
+
|
||||
+if test "x$USE_LIBUSB20" = "xyes"; then
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define HAVE_LIBUSB20 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -25602,6 +25690,13 @@ echo "$as_me: error: conditional \"HALD_
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
+if test -z "${HAVE_LIBUSB20_TRUE}" && test -z "${HAVE_LIBUSB20_FALSE}"; then
|
||||
+ { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBUSB20\" was never defined.
|
||||
+Usually this means the macro was only invoked conditionally." >&5
|
||||
+echo "$as_me: error: conditional \"HAVE_LIBUSB20\" was never defined.
|
||||
+Usually this means the macro was only invoked conditionally." >&2;}
|
||||
+ { (exit 1); exit 1; }; }
|
||||
+fi
|
||||
if test -z "${HAVE_CONKIT_TRUE}" && test -z "${HAVE_CONKIT_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"HAVE_CONKIT\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
@@ -26568,6 +26663,8 @@ HALD_COMPILE_FREEBSD_FALSE!$HALD_COMPILE
|
||||
HALD_COMPILE_SOLARIS_TRUE!$HALD_COMPILE_SOLARIS_TRUE$ac_delim
|
||||
HALD_COMPILE_SOLARIS_FALSE!$HALD_COMPILE_SOLARIS_FALSE$ac_delim
|
||||
HALD_BACKEND!$HALD_BACKEND$ac_delim
|
||||
+HAVE_LIBUSB20_TRUE!$HAVE_LIBUSB20_TRUE$ac_delim
|
||||
+HAVE_LIBUSB20_FALSE!$HAVE_LIBUSB20_FALSE$ac_delim
|
||||
HAVE_CONKIT_TRUE!$HAVE_CONKIT_TRUE$ac_delim
|
||||
HAVE_CONKIT_FALSE!$HAVE_CONKIT_FALSE$ac_delim
|
||||
GPERF!$GPERF$ac_delim
|
||||
@@ -26598,8 +26695,6 @@ DBUS_LIBS!$DBUS_LIBS$ac_delim
|
||||
GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim
|
||||
GLIB_LIBS!$GLIB_LIBS$ac_delim
|
||||
VOLUME_ID_CFLAGS!$VOLUME_ID_CFLAGS$ac_delim
|
||||
-VOLUME_ID_LIBS!$VOLUME_ID_LIBS$ac_delim
|
||||
-HALD_OS_LIBS!$HALD_OS_LIBS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
|
||||
@@ -26641,6 +26736,8 @@ _ACEOF
|
||||
ac_delim='%!_!# '
|
||||
for ac_last_try in false false false false false :; do
|
||||
cat >conf$$subs.sed <<_ACEOF
|
||||
+VOLUME_ID_LIBS!$VOLUME_ID_LIBS$ac_delim
|
||||
+HALD_OS_LIBS!$HALD_OS_LIBS$ac_delim
|
||||
XMLTO!$XMLTO$ac_delim
|
||||
XMLLINT!$XMLLINT$ac_delim
|
||||
DOCBOOK_DOCS_ENABLED_TRUE!$DOCBOOK_DOCS_ENABLED_TRUE$ac_delim
|
||||
@@ -26672,7 +26769,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then
|
||||
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
25
sysutils/hal/files/patch-configure.in
Normal file
25
sysutils/hal/files/patch-configure.in
Normal file
@@ -0,0 +1,25 @@
|
||||
--- configure.in.orig 2008-05-07 19:24:31.000000000 -0400
|
||||
+++ configure.in 2009-02-18 00:28:01.000000000 -0500
|
||||
@@ -446,6 +446,7 @@ if test "x$with_libpci" != xno ; then
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_LIBPCI], [test "x$USE_LIBPCI" = "xyes"])
|
||||
|
||||
+USE_LIBUSB20=no
|
||||
AC_ARG_WITH([backend],
|
||||
AS_HELP_STRING([--with-backend=<name>],
|
||||
[backend to use (linux/solaris/freebsd/dummy)]),
|
||||
@@ -473,6 +474,14 @@ AM_CONDITIONAL(HALD_COMPILE_LINUX, [test
|
||||
AM_CONDITIONAL(HALD_COMPILE_FREEBSD, [test x$HALD_BACKEND = xfreebsd], [Compiling for FreeBSD])
|
||||
AM_CONDITIONAL(HALD_COMPILE_SOLARIS, [test x$HALD_BACKEND = xsolaris], [Compiling for Solaris])
|
||||
AC_SUBST(HALD_BACKEND)
|
||||
+if test "x$HALD_BACKEND" = "xfreebsd"; then
|
||||
+ AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_LIBUSB20=yes], [USE_LIBUSB20=no])
|
||||
+fi
|
||||
+AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB20" = "xyes"])
|
||||
+if test "x$USE_LIBUSB20" = "xyes"; then
|
||||
+ AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20])
|
||||
+fi
|
||||
+
|
||||
|
||||
dnl DBUS API is subject to changes
|
||||
AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, [], [DBUS API is subject to change])
|
||||
@@ -1,27 +1,6 @@
|
||||
diff -p -up hal-0.5.11/configure.in.ck03 hal-0.5.11/configure.in
|
||||
--- hal-0.5.11/configure.in.ck03 2008-05-07 19:24:31.000000000 -0400
|
||||
+++ configure.in 2008-08-11 06:18:07.000000000 -0400
|
||||
@@ -485,6 +485,20 @@ if test "x$enable_console_kit" != "xno";
|
||||
AM_CONDITIONAL(HAVE_CONKIT, true)
|
||||
AC_DEFINE(HAVE_CONKIT, [], [Set if we use ConsoleKit])
|
||||
msg_conkit=yes
|
||||
+ # yes this is ugly, but there is no other way to get the version of CK
|
||||
+ AC_MSG_CHECKING([if ConsoleKit version 0.3.0 or newer])
|
||||
+ if $PKG_CONFIG --atleast-version=0.3.0 ck-connector; then
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ AC_DEFINE(HAVE_CK_0_3, 1, [Define to 1 if ConsoleKit is v0.3.0 or newer])
|
||||
+ else
|
||||
+ if $PKG_CONFIG --max-version=0.2.10 ck-connector; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ else
|
||||
+ #assume we have the latest version
|
||||
+ AC_MSG_WARN([Couldn't detect ConsoleKit version, install the devel package, assume for now you use >= 0.3.0])
|
||||
+ AC_DEFINE(HAVE_CK_0_3, 1, [Define to 1 if ConsoleKit is v0.3.0 or newer])
|
||||
+ fi
|
||||
+ fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(GPERF, [gperf], [no])
|
||||
diff -p -up hal-0.5.11/hald/ck-tracker.c.ck03 hal-0.5.11/hald/ck-tracker.c
|
||||
--- hal-0.5.11/hald/ck-tracker.c.ck03 2008-05-07 19:23:48.000000000 -0400
|
||||
+++ hald/ck-tracker.c 2008-08-12 12:34:47.000000000 -0400
|
||||
|
||||
14
sysutils/hal/files/patch-hald_freebsd_Makefile.am
Normal file
14
sysutils/hal/files/patch-hald_freebsd_Makefile.am
Normal file
@@ -0,0 +1,14 @@
|
||||
--- hald/freebsd/Makefile.am.orig 2009-02-17 18:58:12.000000000 -0500
|
||||
+++ hald/freebsd/Makefile.am 2009-02-18 00:16:12.000000000 -0500
|
||||
@@ -54,4 +54,11 @@ libhald_freebsd_la_SOURCES = \
|
||||
|
||||
libhald_freebsd_la_LDFLAGS = -lcam
|
||||
|
||||
+if HAVE_LIBUSB20
|
||||
+libhald_freebsd_la_SOURCES += \
|
||||
+ hf-usb2.c \
|
||||
+ hf-usb2.h
|
||||
+libhald_freebsd_la_LDFLAGS += -lusb20
|
||||
+endif
|
||||
+
|
||||
EXTRA_DIST = README TODO
|
||||
117
sysutils/hal/files/patch-hald_freebsd_Makefile.in
Normal file
117
sysutils/hal/files/patch-hald_freebsd_Makefile.in
Normal file
@@ -0,0 +1,117 @@
|
||||
--- hald/freebsd/Makefile.in.orig 2009-02-17 18:59:04.000000000 -0500
|
||||
+++ hald/freebsd/Makefile.in 2009-02-18 00:18:00.000000000 -0500
|
||||
@@ -32,6 +32,11 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
+@HAVE_LIBUSB20_TRUE@am__append_1 = \
|
||||
+@HAVE_LIBUSB20_TRUE@ hf-usb2.c \
|
||||
+@HAVE_LIBUSB20_TRUE@ hf-usb2.h
|
||||
+
|
||||
+@HAVE_LIBUSB20_TRUE@am__append_2 = -lusb20
|
||||
subdir = hald/freebsd
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
@@ -44,11 +49,20 @@ CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libhald_freebsd_la_LIBADD =
|
||||
+am__libhald_freebsd_la_SOURCES_DIST = hf-acpi.c hf-acpi.h hf-ata.c \
|
||||
+ hf-ata.h hf-block.c hf-block.h hf-computer.c hf-computer.h \
|
||||
+ hf-devd.c hf-devd.h hf-devtree.c hf-devtree.h hf-drm.c \
|
||||
+ hf-drm.h hf-net.c hf-net.h hf-osspec.h hf-pci.c hf-pci.h \
|
||||
+ hf-pcmcia.c hf-pcmcia.h hf-scsi.c hf-scsi.h hf-serial.c \
|
||||
+ hf-serial.h hf-sound.c hf-sound.h hf-storage.c hf-storage.h \
|
||||
+ hf-usb.c hf-usb.h hf-util.c hf-util.h hf-volume.c hf-volume.h \
|
||||
+ osspec.c hal-file-monitor.c hf-usb2.c hf-usb2.h
|
||||
+@HAVE_LIBUSB20_TRUE@am__objects_1 = hf-usb2.lo
|
||||
am_libhald_freebsd_la_OBJECTS = hf-acpi.lo hf-ata.lo hf-block.lo \
|
||||
hf-computer.lo hf-devd.lo hf-devtree.lo hf-drm.lo hf-net.lo \
|
||||
hf-pci.lo hf-pcmcia.lo hf-scsi.lo hf-serial.lo hf-sound.lo \
|
||||
hf-storage.lo hf-usb.lo hf-util.lo hf-volume.lo osspec.lo \
|
||||
- hal-file-monitor.lo
|
||||
+ hal-file-monitor.lo $(am__objects_1)
|
||||
libhald_freebsd_la_OBJECTS = $(am_libhald_freebsd_la_OBJECTS)
|
||||
libhald_freebsd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
@@ -67,7 +81,7 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libhald_freebsd_la_SOURCES)
|
||||
-DIST_SOURCES = $(libhald_freebsd_la_SOURCES)
|
||||
+DIST_SOURCES = $(am__libhald_freebsd_la_SOURCES_DIST)
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
@@ -228,6 +242,7 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
+top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = libprobe probing addons .
|
||||
@@ -241,46 +256,15 @@ AM_CPPFLAGS = \
|
||||
@GLIB_CFLAGS@ @DBUS_CFLAGS@ @POLKIT_CFLAGS@
|
||||
|
||||
@HALD_COMPILE_FREEBSD_TRUE@noinst_LTLIBRARIES = libhald_freebsd.la
|
||||
-libhald_freebsd_la_SOURCES = \
|
||||
- hf-acpi.c \
|
||||
- hf-acpi.h \
|
||||
- hf-ata.c \
|
||||
- hf-ata.h \
|
||||
- hf-block.c \
|
||||
- hf-block.h \
|
||||
- hf-computer.c \
|
||||
- hf-computer.h \
|
||||
- hf-devd.c \
|
||||
- hf-devd.h \
|
||||
- hf-devtree.c \
|
||||
- hf-devtree.h \
|
||||
- hf-drm.c \
|
||||
- hf-drm.h \
|
||||
- hf-net.c \
|
||||
- hf-net.h \
|
||||
- hf-osspec.h \
|
||||
- hf-pci.c \
|
||||
- hf-pci.h \
|
||||
- hf-pcmcia.c \
|
||||
- hf-pcmcia.h \
|
||||
- hf-scsi.c \
|
||||
- hf-scsi.h \
|
||||
- hf-serial.c \
|
||||
- hf-serial.h \
|
||||
- hf-sound.c \
|
||||
- hf-sound.h \
|
||||
- hf-storage.c \
|
||||
- hf-storage.h \
|
||||
- hf-usb.c \
|
||||
- hf-usb.h \
|
||||
- hf-util.c \
|
||||
- hf-util.h \
|
||||
- hf-volume.c \
|
||||
- hf-volume.h \
|
||||
- osspec.c \
|
||||
- hal-file-monitor.c
|
||||
-
|
||||
-libhald_freebsd_la_LDFLAGS = -lcam
|
||||
+libhald_freebsd_la_SOURCES = hf-acpi.c hf-acpi.h hf-ata.c hf-ata.h \
|
||||
+ hf-block.c hf-block.h hf-computer.c hf-computer.h hf-devd.c \
|
||||
+ hf-devd.h hf-devtree.c hf-devtree.h hf-drm.c hf-drm.h hf-net.c \
|
||||
+ hf-net.h hf-osspec.h hf-pci.c hf-pci.h hf-pcmcia.c hf-pcmcia.h \
|
||||
+ hf-scsi.c hf-scsi.h hf-serial.c hf-serial.h hf-sound.c \
|
||||
+ hf-sound.h hf-storage.c hf-storage.h hf-usb.c hf-usb.h \
|
||||
+ hf-util.c hf-util.h hf-volume.c hf-volume.h osspec.c \
|
||||
+ hal-file-monitor.c $(am__append_1)
|
||||
+libhald_freebsd_la_LDFLAGS = -lcam $(am__append_2)
|
||||
EXTRA_DIST = README TODO
|
||||
all: all-recursive
|
||||
|
||||
@@ -349,6 +333,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-sound.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-storage.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-usb.Plo@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-usb2.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-util.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-volume.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osspec.Plo@am__quote@
|
||||
46
sysutils/hal/files/patch-hald_freebsd_hf-devd.c
Normal file
46
sysutils/hal/files/patch-hald_freebsd_hf-devd.c
Normal file
@@ -0,0 +1,46 @@
|
||||
--- hald/freebsd/hf-devd.c.orig 2008-05-07 19:23:59.000000000 -0400
|
||||
+++ hald/freebsd/hf-devd.c 2009-02-23 01:44:32.000000000 -0500
|
||||
@@ -40,7 +40,11 @@
|
||||
#include "hf-acpi.h"
|
||||
#include "hf-net.h"
|
||||
#include "hf-pcmcia.h"
|
||||
+#include "hf-storage.h"
|
||||
#include "hf-usb.h"
|
||||
+#ifdef HAVE_LIBUSB20
|
||||
+#include "hf-usb2.h"
|
||||
+#endif
|
||||
#include "hf-util.h"
|
||||
|
||||
#define HF_DEVD_SOCK_PATH "/var/run/devd.pipe"
|
||||
@@ -51,10 +55,14 @@
|
||||
#define HF_DEVD_EVENT_NOMATCH '?'
|
||||
|
||||
static HFDevdHandler *handlers[] = {
|
||||
+#ifdef HAVE_LIBUSB20
|
||||
+ &hf_usb2_devd_handler,
|
||||
+#endif
|
||||
&hf_usb_devd_handler,
|
||||
&hf_net_devd_handler,
|
||||
&hf_acpi_devd_handler,
|
||||
- &hf_pcmcia_devd_handler
|
||||
+ &hf_pcmcia_devd_handler,
|
||||
+ &hf_storage_devd_handler
|
||||
};
|
||||
|
||||
static gboolean hf_devd_inited = FALSE;
|
||||
@@ -381,13 +389,13 @@ hf_devd_event_cb (GIOChannel *source, GI
|
||||
|
||||
status = g_io_channel_read_line(source, &event, NULL, &terminator, NULL);
|
||||
|
||||
- if (status != G_IO_STATUS_NORMAL)
|
||||
+ if (status == G_IO_STATUS_NORMAL)
|
||||
{
|
||||
event[terminator] = 0;
|
||||
hf_devd_process_event(event);
|
||||
g_free(event);
|
||||
}
|
||||
- else if (status != G_IO_STATUS_AGAIN)
|
||||
+ else if (status == G_IO_STATUS_AGAIN)
|
||||
{
|
||||
hf_devd_init();
|
||||
if (hf_devd_inited)
|
||||
@@ -1,5 +1,5 @@
|
||||
--- hald/freebsd/hf-devtree.c.orig 2008-05-07 19:24:03.000000000 -0400
|
||||
+++ hald/freebsd/hf-devtree.c 2009-01-30 14:30:57.000000000 -0500
|
||||
+++ hald/freebsd/hf-devtree.c 2009-02-16 18:48:41.000000000 -0500
|
||||
@@ -86,7 +86,11 @@ hf_devtree_cpu_can_throttle (int cpu)
|
||||
gboolean can = FALSE;
|
||||
char *levels;
|
||||
@@ -24,7 +24,17 @@
|
||||
if (levels)
|
||||
{
|
||||
sscanf(levels, "%i/", &freq);
|
||||
@@ -426,7 +434,13 @@ hf_devtree_probe (void)
|
||||
@@ -379,7 +387,8 @@ static Handler handlers[] = {
|
||||
{ "pcm", NULL },
|
||||
{ "psm", hf_devtree_psm_set_properties },
|
||||
{ "sio", NULL },
|
||||
- { "speaker", NULL }
|
||||
+ { "speaker", NULL },
|
||||
+ { "usbus", NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -426,7 +435,13 @@ hf_devtree_probe (void)
|
||||
HalDevice *device;
|
||||
|
||||
device = hf_devtree_device_new(parent, info->handler, info->unit);
|
||||
@@ -39,7 +49,7 @@
|
||||
}
|
||||
|
||||
devices = g_slist_delete_link(devices, root);
|
||||
@@ -434,6 +448,17 @@ hf_devtree_probe (void)
|
||||
@@ -434,6 +449,17 @@ hf_devtree_probe (void)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +67,7 @@
|
||||
HalDevice *
|
||||
hf_devtree_find_from_name (HalDeviceStore *store, const char *name)
|
||||
{
|
||||
@@ -597,5 +622,6 @@ hf_devtree_is_driver (const char *name,
|
||||
@@ -597,5 +623,6 @@ hf_devtree_is_driver (const char *name,
|
||||
}
|
||||
|
||||
HFHandler hf_devtree_handler = {
|
||||
|
||||
13
sysutils/hal/files/patch-hald_freebsd_hf-storage.h
Normal file
13
sysutils/hal/files/patch-hald_freebsd_hf-storage.h
Normal file
@@ -0,0 +1,13 @@
|
||||
--- hald/freebsd/hf-storage.h.orig 2009-02-23 01:43:49.000000000 -0500
|
||||
+++ hald/freebsd/hf-storage.h 2009-02-23 01:45:17.000000000 -0500
|
||||
@@ -29,8 +29,10 @@
|
||||
#endif
|
||||
|
||||
#include "hf-osspec.h"
|
||||
+#include "hf-devd.h"
|
||||
|
||||
extern HFHandler hf_storage_handler;
|
||||
+extern HFDevdHandler hf_storage_devd_handler;
|
||||
|
||||
void hf_storage_device_enable (HalDevice *device);
|
||||
void hf_storage_device_enable_tape (HalDevice *device);
|
||||
@@ -1,5 +1,5 @@
|
||||
--- hald/freebsd/hf-usb.c.orig 2008-05-07 19:24:02.000000000 -0400
|
||||
+++ hald/freebsd/hf-usb.c 2009-02-15 22:17:58.000000000 -0500
|
||||
+++ hald/freebsd/hf-usb.c 2009-02-17 19:38:21.000000000 -0500
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "hf-util.h"
|
||||
|
||||
@@ -8,7 +8,32 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -575,6 +576,8 @@ hf_usb_probe_device (HalDevice *parent,
|
||||
@@ -231,7 +232,7 @@ hf_usb_get_full_config_descriptor (int f
|
||||
* Adapted from usb_compute_udi() in linux2/physdev.c and
|
||||
* usbclass_compute_udi() in linux2/classdev.c.
|
||||
*/
|
||||
-static void
|
||||
+void
|
||||
hf_usb_device_compute_udi (HalDevice *device)
|
||||
{
|
||||
g_return_if_fail(HAL_IS_DEVICE(device));
|
||||
@@ -250,12 +251,13 @@ hf_usb_device_compute_udi (HalDevice *de
|
||||
hf_device_set_udi(device, "usb_device_%x_%x_%s",
|
||||
hal_device_property_get_int(device, "usb_device.vendor_id"),
|
||||
hal_device_property_get_int(device, "usb_device.product_id"),
|
||||
- hal_device_has_property(device, "usb_device.serial")
|
||||
+ (hal_device_has_property(device, "usb_device.serial") &&
|
||||
+ strcmp(hal_device_property_get_string(device, "usb_device.serial"), ""))
|
||||
? hal_device_property_get_string(device, "usb_device.serial")
|
||||
: "noserial");
|
||||
}
|
||||
|
||||
-static void
|
||||
+void
|
||||
hf_usb_add_webcam_properties (HalDevice *device)
|
||||
{
|
||||
int unit;
|
||||
@@ -575,6 +577,8 @@ hf_usb_probe_device (HalDevice *parent,
|
||||
{
|
||||
if (hal_device_has_capability(device, "hiddev"))
|
||||
hf_runner_run_sync(device, 0, "hald-probe-hiddev", NULL);
|
||||
@@ -17,7 +42,7 @@
|
||||
|
||||
hf_device_add(device);
|
||||
}
|
||||
@@ -633,9 +636,18 @@ hf_usb_privileged_init (void)
|
||||
@@ -633,9 +637,18 @@ hf_usb_privileged_init (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
10
sysutils/hal/files/patch-hald_freebsd_hf-usb.h
Normal file
10
sysutils/hal/files/patch-hald_freebsd_hf-usb.h
Normal file
@@ -0,0 +1,10 @@
|
||||
--- hald/freebsd/hf-usb.h.orig 2009-02-17 18:56:56.000000000 -0500
|
||||
+++ hald/freebsd/hf-usb.h 2009-02-17 18:57:21.000000000 -0500
|
||||
@@ -34,4 +34,7 @@
|
||||
extern HFHandler hf_usb_handler;
|
||||
extern HFDevdHandler hf_usb_devd_handler;
|
||||
|
||||
+void hf_usb_device_compute_udi(HalDevice *device);
|
||||
+void hf_usb_add_webcam_properties(HalDevice *device);
|
||||
+
|
||||
#endif /* _HF_USB_H */
|
||||
290
sysutils/hal/files/patch-hald_freebsd_hf-usb2.c
Normal file
290
sysutils/hal/files/patch-hald_freebsd_hf-usb2.c
Normal file
@@ -0,0 +1,290 @@
|
||||
--- hald/freebsd/hf-usb2.c.orig 2009-02-17 18:58:44.000000000 -0500
|
||||
+++ hald/freebsd/hf-usb2.c 2009-02-17 23:22:47.000000000 -0500
|
||||
@@ -0,0 +1,287 @@
|
||||
+/***************************************************************************
|
||||
+ * CVSID: $Id$
|
||||
+ *
|
||||
+ * hf-usb.c : USB support
|
||||
+ *
|
||||
+ * Copyright (C) 2009 Joe Marcus Clarke <marcus@FreeBSD.org>
|
||||
+ *
|
||||
+ * 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
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ **************************************************************************/
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <errno.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <libusb20.h>
|
||||
+
|
||||
+#include "../logger.h"
|
||||
+#include "../osspec.h"
|
||||
+
|
||||
+#include "hf-usb.h"
|
||||
+#include "hf-usb2.h"
|
||||
+#include "hf-devtree.h"
|
||||
+#include "hf-util.h"
|
||||
+
|
||||
+static struct libusb20_backend *hf_usb2_be = NULL;
|
||||
+
|
||||
+static void
|
||||
+hf_usb2_copy_parent (HalDevice *parent,
|
||||
+ const char *key,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ HalDevice *device;
|
||||
+
|
||||
+ g_return_if_fail(HAL_IS_DEVICE(parent));
|
||||
+ g_return_if_fail(HAL_IS_DEVICE(user_data));
|
||||
+
|
||||
+ device = HAL_DEVICE(user_data);
|
||||
+
|
||||
+ if (! strncmp(key, "usb_device.", strlen("usb_device.")))
|
||||
+ hal_device_copy_property(parent, key, device, key);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+hf_usb2_probe_interfaces(HalDevice *parent)
|
||||
+{
|
||||
+ int num_interfaces;
|
||||
+ int i;
|
||||
+
|
||||
+ g_return_if_fail(HAL_IS_DEVICE(parent));
|
||||
+
|
||||
+ if (hal_device_property_get_bool(parent, "info.ignore"))
|
||||
+ return;
|
||||
+
|
||||
+ num_interfaces = hal_device_property_get_int(parent,
|
||||
+ "usb_device.num_interfaces");
|
||||
+
|
||||
+ for (i = 0; i < num_interfaces; i++)
|
||||
+ {
|
||||
+ HalDevice *device;
|
||||
+
|
||||
+ device = hf_device_new(parent);
|
||||
+
|
||||
+ hal_device_property_set_string(device, "info.subsystem", "usb");
|
||||
+ hal_device_property_set_int(device, "usb.interface.number", i);
|
||||
+ hal_device_property_foreach(parent, hf_usb2_copy_parent, device);
|
||||
+ hal_device_copy_property(parent, "info.product", device, "info.product");
|
||||
+ hal_device_copy_property(parent, "info.vendor", device, "info.vendor");
|
||||
+
|
||||
+ if (hf_device_preprobe(device))
|
||||
+ {
|
||||
+ const char *driver, *devname;
|
||||
+
|
||||
+ hf_runner_run_sync(device, 0, "hald-probe-usb2-interface", NULL);
|
||||
+
|
||||
+ devname = hal_device_property_get_string(device,
|
||||
+ "usb.freebsd.devname");
|
||||
+ if (devname)
|
||||
+ hf_devtree_device_set_name(device, devname);
|
||||
+
|
||||
+ driver = hal_device_property_get_string(device, "freebsd.driver");
|
||||
+ if (driver)
|
||||
+ {
|
||||
+ if (! strcmp(driver, "ukbd"))
|
||||
+ hf_device_set_input(device, "keyboard", devname);
|
||||
+ else if (! strcmp(driver, "ums"))
|
||||
+ {
|
||||
+ hf_device_set_input(device, "mouse", devname);
|
||||
+ hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL);
|
||||
+ }
|
||||
+ else if (! strcmp(driver, "uhid"))
|
||||
+ {
|
||||
+ hal_device_property_set_string(device, "info.category",
|
||||
+ "hiddev");
|
||||
+ hal_device_add_capability(device, "hiddev");
|
||||
+ hf_device_property_set_string_printf(device, "hiddev.device",
|
||||
+ "/dev/%s", devname);
|
||||
+ hal_device_copy_property(device, "info.product", device,
|
||||
+ "hiddev.product");
|
||||
+ hf_runner_run_sync(device, 0, "hald-probe-hiddev", NULL);
|
||||
+ }
|
||||
+ else if (! strcmp(driver, "ldev"))
|
||||
+ {
|
||||
+ /* Linux driver (webcam) */
|
||||
+
|
||||
+ /*
|
||||
+ * XXX This is a hack. Currently, all ldev devices are
|
||||
+ * webcams. That may not always be the case. Hopefully,
|
||||
+ * when other Linux driver support is added, there will be
|
||||
+ * a sysctl or some other way to determine device class.
|
||||
+ */
|
||||
+ hf_usb_add_webcam_properties(device);
|
||||
+ }
|
||||
+ else if (! strcmp(driver, "pwc"))
|
||||
+ {
|
||||
+ /* Phillips Web Cam */
|
||||
+ hf_usb_add_webcam_properties(device);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ hf_usb_device_compute_udi(device);
|
||||
+ hf_device_add(device);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+hf_usb2_probe_device (HalDevice *parent, int bus, int addr)
|
||||
+{
|
||||
+ HalDevice *device;
|
||||
+
|
||||
+ g_return_if_fail(HAL_IS_DEVICE(parent));
|
||||
+
|
||||
+ device = hf_device_new(parent);
|
||||
+
|
||||
+ hal_device_property_set_string(device, "info.subsystem", "usb_device");
|
||||
+ hal_device_property_set_int(device, "usb_device.bus_number", bus);
|
||||
+ hal_device_property_set_int(device, "usb_device.level_number", addr - 1);
|
||||
+ hal_device_property_set_int(device, "usb_device.port_number", addr);
|
||||
+
|
||||
+ if (hf_device_preprobe(device))
|
||||
+ {
|
||||
+ hf_runner_run_sync(device, 0, "hald-probe-usb2-device", NULL);
|
||||
+ hf_usb_device_compute_udi(device);
|
||||
+
|
||||
+ hf_device_add(device);
|
||||
+ }
|
||||
+ else
|
||||
+ return;
|
||||
+
|
||||
+ hf_usb2_probe_interfaces(device);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+hf_usb2_privileged_init (void)
|
||||
+{
|
||||
+ hf_usb2_be = libusb20_be_alloc_default();
|
||||
+ if (hf_usb2_be == NULL)
|
||||
+ HAL_INFO(("unable to open USB backend: %s", g_strerror(errno)));
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+hf_usb2_probe (void)
|
||||
+{
|
||||
+ struct libusb20_device *pdev = NULL;
|
||||
+
|
||||
+ if (hf_usb2_be == NULL)
|
||||
+ return;
|
||||
+
|
||||
+ while ((pdev = libusb20_be_device_foreach(hf_usb2_be, pdev)))
|
||||
+ {
|
||||
+ HalDevice *parent;
|
||||
+ int bus, addr;
|
||||
+
|
||||
+ bus = libusb20_dev_get_bus_number(pdev);
|
||||
+ addr = libusb20_dev_get_address(pdev);
|
||||
+
|
||||
+ if (addr == 1)
|
||||
+ parent = hf_devtree_find_parent_from_info(hald_get_gdl(), "usbus", bus);
|
||||
+ else
|
||||
+ parent = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
|
||||
+ HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
|
||||
+ HAL_PROPERTY_TYPE_INT32, addr - 1, NULL);
|
||||
+ if (! parent || hal_device_property_get_bool(parent, "info.ignore"))
|
||||
+ continue;
|
||||
+
|
||||
+ hf_usb2_probe_device(parent, bus, addr);
|
||||
+ }
|
||||
+
|
||||
+ libusb20_be_free(hf_usb2_be);
|
||||
+ hf_usb2_be = NULL;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+hf_usb2_devd_add (const char *name,
|
||||
+ GHashTable *params,
|
||||
+ GHashTable *at,
|
||||
+ const char *parent)
|
||||
+{
|
||||
+ HalDevice *parent_device;
|
||||
+ int bus, addr, pbus, paddr;
|
||||
+
|
||||
+ if (strncmp(name, "ugen", strlen("ugen")))
|
||||
+ return FALSE;
|
||||
+ else if (strncmp(parent, "ugen", strlen("ugen")))
|
||||
+ return TRUE;
|
||||
+
|
||||
+ if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (sscanf(parent, "ugen%i.%i", &pbus, &paddr) != 2)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ HAL_INFO(("received devd add event for device '%s' with parent '%s'",
|
||||
+ name, parent));
|
||||
+
|
||||
+ parent_device = hf_device_store_match(hald_get_gdl(),
|
||||
+ "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, pbus,
|
||||
+ "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, NULL);
|
||||
+
|
||||
+ if (parent_device && ! hal_device_property_get_bool(parent_device,
|
||||
+ "info.ignore"))
|
||||
+ {
|
||||
+ hf_usb2_probe_device(parent_device, bus, addr);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+hf_usb2_devd_remove (const char *name,
|
||||
+ GHashTable *params,
|
||||
+ GHashTable *at,
|
||||
+ const char *parent)
|
||||
+{
|
||||
+ HalDevice *device;
|
||||
+ int bus, addr;
|
||||
+
|
||||
+ if (strncmp(name, "ugen", strlen("ugen")))
|
||||
+ return FALSE;
|
||||
+ else if (strncmp(parent, "ugen", strlen("ugen")))
|
||||
+ return TRUE;
|
||||
+
|
||||
+ if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ HAL_INFO(("received devd remove event, device %s", name));
|
||||
+
|
||||
+ device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
|
||||
+ HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
|
||||
+ HAL_PROPERTY_TYPE_INT32, addr, NULL);
|
||||
+
|
||||
+ if (device)
|
||||
+ {
|
||||
+ hf_device_remove_tree(device);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+HFHandler hf_usb2_handler = {
|
||||
+ .privileged_init = hf_usb2_privileged_init,
|
||||
+ .probe = hf_usb2_probe
|
||||
+};
|
||||
+
|
||||
+HFDevdHandler hf_usb2_devd_handler = {
|
||||
+ .add = hf_usb2_devd_add,
|
||||
+ .remove = hf_usb2_devd_remove
|
||||
+};
|
||||
40
sysutils/hal/files/patch-hald_freebsd_hf-usb2.h
Normal file
40
sysutils/hal/files/patch-hald_freebsd_hf-usb2.h
Normal file
@@ -0,0 +1,40 @@
|
||||
--- hald/freebsd/hf-usb2.h.orig 2009-02-18 00:22:59.000000000 -0500
|
||||
+++ hald/freebsd/hf-usb2.h 2009-02-18 00:22:54.000000000 -0500
|
||||
@@ -0,0 +1,37 @@
|
||||
+/***************************************************************************
|
||||
+ * CVSID: $Id$
|
||||
+ *
|
||||
+ * hf-usb.h : USB support
|
||||
+ *
|
||||
+ * Copyright (C) 2009 Joe Marcus Clarke <marcus@FreeBSD.org>
|
||||
+ *
|
||||
+ * 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
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ **************************************************************************/
|
||||
+
|
||||
+#ifndef _HF_USB2_H
|
||||
+#define _HF_USB2_H
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include "hf-osspec.h"
|
||||
+#include "hf-devd.h"
|
||||
+
|
||||
+extern HFHandler hf_usb2_handler;
|
||||
+extern HFDevdHandler hf_usb2_devd_handler;
|
||||
+
|
||||
+#endif /* _HF_USB2_H */
|
||||
22
sysutils/hal/files/patch-hald_freebsd_osspec.c
Normal file
22
sysutils/hal/files/patch-hald_freebsd_osspec.c
Normal file
@@ -0,0 +1,22 @@
|
||||
--- hald/freebsd/osspec.c.orig 2008-05-07 19:24:01.000000000 -0400
|
||||
+++ hald/freebsd/osspec.c 2009-02-18 00:24:42.000000000 -0500
|
||||
@@ -46,6 +46,9 @@
|
||||
#include "hf-sound.h"
|
||||
#include "hf-storage.h"
|
||||
#include "hf-usb.h"
|
||||
+#ifdef HAVE_LIBUSB20
|
||||
+#include "hf-usb2.h"
|
||||
+#endif
|
||||
#include "hf-volume.h"
|
||||
|
||||
/* the order matters: PCI devices must be created before their children, etc */
|
||||
@@ -53,6 +56,9 @@ static HFHandler *handlers[] = {
|
||||
&hf_pci_handler,
|
||||
&hf_devtree_handler,
|
||||
&hf_usb_handler,
|
||||
+#ifdef HAVE_LIBUSB20
|
||||
+ &hf_usb2_handler,
|
||||
+#endif
|
||||
&hf_ata_handler,
|
||||
&hf_scsi_handler,
|
||||
&hf_storage_handler,
|
||||
@@ -1,17 +1,44 @@
|
||||
--- hald/freebsd/probing/Makefile.am.orig 2008-05-07 19:24:08.000000000 -0400
|
||||
+++ hald/freebsd/probing/Makefile.am 2009-01-25 18:13:33.000000000 -0500
|
||||
@@ -10,6 +10,7 @@ AM_CPPFLAGS = \
|
||||
+++ hald/freebsd/probing/Makefile.am 2009-02-18 00:16:28.000000000 -0500
|
||||
@@ -9,11 +9,18 @@ AM_CPPFLAGS = \
|
||||
|
||||
if HALD_COMPILE_FREEBSD
|
||||
libexec_PROGRAMS = \
|
||||
hald-probe-hiddev \
|
||||
+ hald-probe-mouse \
|
||||
hald-probe-scsi \
|
||||
hald-probe-smbios \
|
||||
hald-probe-storage \
|
||||
@@ -21,6 +22,13 @@ hald_probe_hiddev_LDADD = \
|
||||
- hald-probe-hiddev \
|
||||
- hald-probe-scsi \
|
||||
- hald-probe-smbios \
|
||||
- hald-probe-storage \
|
||||
+ hald-probe-hiddev \
|
||||
+ hald-probe-mouse \
|
||||
+ hald-probe-scsi \
|
||||
+ hald-probe-smbios \
|
||||
+ hald-probe-storage \
|
||||
hald-probe-volume
|
||||
+
|
||||
+if HAVE_LIBUSB20
|
||||
+libexec_PROGRAMS += \
|
||||
+ hald-probe-usb2-device \
|
||||
+ hald-probe-usb2-interface
|
||||
+endif
|
||||
endif
|
||||
|
||||
hald_probe_hiddev_SOURCES = probe-hiddev.c
|
||||
@@ -21,6 +28,25 @@ hald_probe_hiddev_LDADD = \
|
||||
$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
-lusbhid
|
||||
|
||||
+if HAVE_LIBUSB20
|
||||
+hald_probe_usb2_device_SOURCES = probe-usb2-device.c
|
||||
+hald_probe_usb2_device_LDADD = \
|
||||
+ $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
+ -lusb20
|
||||
+
|
||||
+hald_probe_usb2_interface_SOURCES = probe-usb2-interface.c
|
||||
+hald_probe_usb2_interface_LDADD = \
|
||||
+ $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
+ -lusb20
|
||||
+endif
|
||||
+
|
||||
+hald_probe_mouse_SOURCES = probe-mouse.c
|
||||
+hald_probe_mouse_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
+hald_probe_mouse_LDADD = \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- hald/freebsd/probing/Makefile.in.orig 2009-01-25 16:54:29.000000000 -0500
|
||||
+++ hald/freebsd/probing/Makefile.in 2009-01-25 18:14:20.000000000 -0500
|
||||
@@ -34,6 +34,7 @@ build_triplet = @build@
|
||||
--- hald/freebsd/probing/Makefile.in.orig 2009-02-15 13:42:09.000000000 -0500
|
||||
+++ hald/freebsd/probing/Makefile.in 2009-02-18 00:18:00.000000000 -0500
|
||||
@@ -34,10 +34,16 @@ build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
@HALD_COMPILE_FREEBSD_TRUE@libexec_PROGRAMS = \
|
||||
@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-hiddev$(EXEEXT) \
|
||||
@@ -8,7 +8,25 @@
|
||||
@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-scsi$(EXEEXT) \
|
||||
@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-smbios$(EXEEXT) \
|
||||
@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-storage$(EXEEXT) \
|
||||
@@ -54,6 +55,9 @@ PROGRAMS = $(libexec_PROGRAMS)
|
||||
-@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-volume$(EXEEXT)
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@ hald-probe-volume$(EXEEXT) \
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@ $(am__EXEEXT_1)
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@@HAVE_LIBUSB20_TRUE@am__append_1 = \
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@@HAVE_LIBUSB20_TRUE@ hald-probe-usb2-device \
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@@HAVE_LIBUSB20_TRUE@ hald-probe-usb2-interface
|
||||
+
|
||||
subdir = hald/freebsd/probing
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
@@ -48,12 +54,17 @@ am__configure_deps = $(am__aclocal_m4_de
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@@HAVE_LIBUSB20_TRUE@am__EXEEXT_1 = hald-probe-usb2-device$(EXEEXT) \
|
||||
+@HALD_COMPILE_FREEBSD_TRUE@@HAVE_LIBUSB20_TRUE@ hald-probe-usb2-interface$(EXEEXT)
|
||||
am__installdirs = "$(DESTDIR)$(libexecdir)"
|
||||
libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(libexec_PROGRAMS)
|
||||
am_hald_probe_hiddev_OBJECTS = probe-hiddev.$(OBJEXT)
|
||||
hald_probe_hiddev_OBJECTS = $(am_hald_probe_hiddev_OBJECTS)
|
||||
hald_probe_hiddev_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
@@ -18,23 +36,46 @@
|
||||
am_hald_probe_scsi_OBJECTS = probe-scsi.$(OBJEXT)
|
||||
hald_probe_scsi_OBJECTS = $(am_hald_probe_scsi_OBJECTS)
|
||||
hald_probe_scsi_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
@@ -82,10 +86,11 @@ CCLD = $(CC)
|
||||
@@ -65,6 +76,17 @@ am_hald_probe_storage_OBJECTS = \
|
||||
hald_probe_storage-probe-storage.$(OBJEXT)
|
||||
hald_probe_storage_OBJECTS = $(am_hald_probe_storage_OBJECTS)
|
||||
hald_probe_storage_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
+am__hald_probe_usb2_device_SOURCES_DIST = probe-usb2-device.c
|
||||
+@HAVE_LIBUSB20_TRUE@am_hald_probe_usb2_device_OBJECTS = \
|
||||
+@HAVE_LIBUSB20_TRUE@ probe-usb2-device.$(OBJEXT)
|
||||
+hald_probe_usb2_device_OBJECTS = $(am_hald_probe_usb2_device_OBJECTS)
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_device_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
+am__hald_probe_usb2_interface_SOURCES_DIST = probe-usb2-interface.c
|
||||
+@HAVE_LIBUSB20_TRUE@am_hald_probe_usb2_interface_OBJECTS = \
|
||||
+@HAVE_LIBUSB20_TRUE@ probe-usb2-interface.$(OBJEXT)
|
||||
+hald_probe_usb2_interface_OBJECTS = \
|
||||
+ $(am_hald_probe_usb2_interface_OBJECTS)
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_interface_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
am_hald_probe_volume_OBJECTS = \
|
||||
hald_probe_volume-freebsd_dvd_rw_utils.$(OBJEXT) \
|
||||
hald_probe_volume-probe-volume.$(OBJEXT)
|
||||
@@ -82,11 +104,17 @@ CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
-SOURCES = $(hald_probe_hiddev_SOURCES) $(hald_probe_scsi_SOURCES) \
|
||||
- $(hald_probe_smbios_SOURCES) $(hald_probe_storage_SOURCES) \
|
||||
- $(hald_probe_volume_SOURCES)
|
||||
-DIST_SOURCES = $(hald_probe_hiddev_SOURCES) $(hald_probe_scsi_SOURCES) \
|
||||
+SOURCES = $(hald_probe_hiddev_SOURCES) $(hald_probe_mouse_SOURCES) \
|
||||
+ $(hald_probe_scsi_SOURCES) $(hald_probe_smbios_SOURCES) \
|
||||
+ $(hald_probe_storage_SOURCES) $(hald_probe_volume_SOURCES)
|
||||
+ $(hald_probe_storage_SOURCES) \
|
||||
+ $(hald_probe_usb2_device_SOURCES) \
|
||||
+ $(hald_probe_usb2_interface_SOURCES) \
|
||||
$(hald_probe_volume_SOURCES)
|
||||
-DIST_SOURCES = $(hald_probe_hiddev_SOURCES) $(hald_probe_scsi_SOURCES) \
|
||||
+DIST_SOURCES = $(hald_probe_hiddev_SOURCES) \
|
||||
+ $(hald_probe_mouse_SOURCES) $(hald_probe_scsi_SOURCES) \
|
||||
$(hald_probe_smbios_SOURCES) $(hald_probe_storage_SOURCES) \
|
||||
+ $(am__hald_probe_usb2_device_SOURCES_DIST) \
|
||||
+ $(am__hald_probe_usb2_interface_SOURCES_DIST) \
|
||||
$(hald_probe_volume_SOURCES)
|
||||
ETAGS = etags
|
||||
@@ -238,6 +243,7 @@ sharedstatedir = @sharedstatedir@
|
||||
CTAGS = ctags
|
||||
@@ -238,6 +266,7 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
@@ -42,10 +83,20 @@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AM_CPPFLAGS = \
|
||||
@@ -254,6 +260,13 @@ hald_probe_hiddev_LDADD = \
|
||||
@@ -254,6 +283,23 @@ hald_probe_hiddev_LDADD = \
|
||||
$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
-lusbhid
|
||||
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_device_SOURCES = probe-usb2-device.c
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_device_LDADD = \
|
||||
+@HAVE_LIBUSB20_TRUE@ $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
+@HAVE_LIBUSB20_TRUE@ -lusb20
|
||||
+
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_interface_SOURCES = probe-usb2-interface.c
|
||||
+@HAVE_LIBUSB20_TRUE@hald_probe_usb2_interface_LDADD = \
|
||||
+@HAVE_LIBUSB20_TRUE@ $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la \
|
||||
+@HAVE_LIBUSB20_TRUE@ -lusb20
|
||||
+
|
||||
+hald_probe_mouse_SOURCES = probe-mouse.c
|
||||
+hald_probe_mouse_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
+hald_probe_mouse_LDADD = \
|
||||
@@ -56,7 +107,7 @@
|
||||
hald_probe_smbios_SOURCES = probe-smbios.c
|
||||
hald_probe_smbios_LDADD = \
|
||||
$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
|
||||
@@ -340,6 +353,9 @@ clean-libexecPROGRAMS:
|
||||
@@ -340,6 +386,9 @@ clean-libexecPROGRAMS:
|
||||
hald-probe-hiddev$(EXEEXT): $(hald_probe_hiddev_OBJECTS) $(hald_probe_hiddev_DEPENDENCIES)
|
||||
@rm -f hald-probe-hiddev$(EXEEXT)
|
||||
$(LINK) $(hald_probe_hiddev_OBJECTS) $(hald_probe_hiddev_LDADD) $(LIBS)
|
||||
@@ -66,7 +117,20 @@
|
||||
hald-probe-scsi$(EXEEXT): $(hald_probe_scsi_OBJECTS) $(hald_probe_scsi_DEPENDENCIES)
|
||||
@rm -f hald-probe-scsi$(EXEEXT)
|
||||
$(LINK) $(hald_probe_scsi_OBJECTS) $(hald_probe_scsi_LDADD) $(LIBS)
|
||||
@@ -359,6 +375,7 @@ mostlyclean-compile:
|
||||
@@ -349,6 +398,12 @@ hald-probe-smbios$(EXEEXT): $(hald_probe
|
||||
hald-probe-storage$(EXEEXT): $(hald_probe_storage_OBJECTS) $(hald_probe_storage_DEPENDENCIES)
|
||||
@rm -f hald-probe-storage$(EXEEXT)
|
||||
$(LINK) $(hald_probe_storage_OBJECTS) $(hald_probe_storage_LDADD) $(LIBS)
|
||||
+hald-probe-usb2-device$(EXEEXT): $(hald_probe_usb2_device_OBJECTS) $(hald_probe_usb2_device_DEPENDENCIES)
|
||||
+ @rm -f hald-probe-usb2-device$(EXEEXT)
|
||||
+ $(LINK) $(hald_probe_usb2_device_OBJECTS) $(hald_probe_usb2_device_LDADD) $(LIBS)
|
||||
+hald-probe-usb2-interface$(EXEEXT): $(hald_probe_usb2_interface_OBJECTS) $(hald_probe_usb2_interface_DEPENDENCIES)
|
||||
+ @rm -f hald-probe-usb2-interface$(EXEEXT)
|
||||
+ $(LINK) $(hald_probe_usb2_interface_OBJECTS) $(hald_probe_usb2_interface_LDADD) $(LIBS)
|
||||
hald-probe-volume$(EXEEXT): $(hald_probe_volume_OBJECTS) $(hald_probe_volume_DEPENDENCIES)
|
||||
@rm -f hald-probe-volume$(EXEEXT)
|
||||
$(LINK) $(hald_probe_volume_OBJECTS) $(hald_probe_volume_LDADD) $(LIBS)
|
||||
@@ -359,6 +414,7 @@ mostlyclean-compile:
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@@ -74,7 +138,16 @@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_probe_storage-freebsd_dvd_rw_utils.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_probe_storage-probe-storage.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hald_probe_volume-freebsd_dvd_rw_utils.Po@am__quote@
|
||||
@@ -388,6 +405,20 @@ distclean-compile:
|
||||
@@ -366,6 +422,8 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe-hiddev.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe-scsi.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe-smbios.Po@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe-usb2-device.Po@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe-usb2-interface.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@@ -388,6 +446,20 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
--- hald/freebsd/probing/probe-usb2-device.c.orig 2009-02-18 00:06:02.000000000 -0500
|
||||
+++ hald/freebsd/probing/probe-usb2-device.c 2009-02-18 00:07:31.000000000 -0500
|
||||
@@ -0,0 +1,198 @@
|
||||
+/***************************************************************************
|
||||
+ * CVSID: $Id$
|
||||
+ *
|
||||
+ * probe-usb2-device.c : USB2 Device poller
|
||||
+ *
|
||||
+ * Copyright (C) 2009 Joe Marcus Clarke <marcus@FreeBSD.org>
|
||||
+ *
|
||||
+ * 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
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ **************************************************************************/
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include <libusb20_desc.h>
|
||||
+#include <libusb20.h>
|
||||
+#include <dev/usb2/include/usb2_standard.h>
|
||||
+#include <dev/usb2/include/usb2_ioctl.h>
|
||||
+
|
||||
+#include "../libprobe/hfp.h"
|
||||
+
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ struct libusb20_backend *pbe = NULL;
|
||||
+ struct libusb20_device *pdev = NULL;
|
||||
+ char *busstr, *addrstr;
|
||||
+ int bus, addr;
|
||||
+
|
||||
+ if (! hfp_init(argc, argv))
|
||||
+ goto end;
|
||||
+
|
||||
+ pbe = libusb20_be_alloc_default();
|
||||
+ if (pbe == NULL)
|
||||
+ goto end;
|
||||
+
|
||||
+ busstr = getenv("HAL_PROP_USB_DEVICE_BUS_NUMBER");
|
||||
+ if (! busstr)
|
||||
+ goto end;
|
||||
+
|
||||
+ addrstr = getenv("HAL_PROP_USB_DEVICE_PORT_NUMBER");
|
||||
+ if (! addrstr)
|
||||
+ goto end;
|
||||
+
|
||||
+ bus = atoi(busstr);
|
||||
+ addr = atoi(addrstr);
|
||||
+
|
||||
+ while ((pdev = libusb20_be_device_foreach(pbe, pdev)))
|
||||
+ {
|
||||
+ struct LIBUSB20_DEVICE_DESC_DECODED *ddesc;
|
||||
+ struct LIBUSB20_CONFIG_DESC_DECODED *cdesc;
|
||||
+ struct usb2_device_info di;
|
||||
+ struct libusb20_config *pcfg = NULL;
|
||||
+ int curr_config;
|
||||
+ int bcdspeed = 0;
|
||||
+ uint8_t temp_string[256];
|
||||
+ double speed = 0.0;
|
||||
+ double version = 1.0;
|
||||
+
|
||||
+ if (libusb20_dev_get_bus_number(pdev) != bus ||
|
||||
+ libusb20_dev_get_address(pdev) != addr)
|
||||
+ continue;
|
||||
+
|
||||
+ if (libusb20_dev_open(pdev, 0))
|
||||
+ continue;
|
||||
+
|
||||
+ ddesc = libusb20_dev_get_device_desc(pdev);
|
||||
+ curr_config = libusb20_dev_get_config_index(pdev);
|
||||
+ pcfg = libusb20_dev_alloc_config(pdev, curr_config);
|
||||
+ cdesc = &(pcfg->desc);
|
||||
+
|
||||
+ if (libusb20_dev_get_info(pdev, &di))
|
||||
+ {
|
||||
+ free(pcfg);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ memset(temp_string, 0, sizeof(temp_string));
|
||||
+
|
||||
+ if (cdesc->iConfiguration !=0)
|
||||
+ libusb20_dev_req_string_simple_sync(pdev, cdesc->iConfiguration,
|
||||
+ temp_string, sizeof(temp_string));
|
||||
+
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.configuration", (char *) temp_string, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.configuration_value", cdesc->bConfigurationValue,
|
||||
+ &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.num_configurations", ddesc->bNumConfigurations,
|
||||
+ &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.device_class", di.udi_class, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.device_subclass", di.udi_subclass, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.device_protocol", di.udi_protocol, &hfp_error);
|
||||
+ libhal_device_set_property_bool(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.is_self_powered",
|
||||
+ di.udi_power == 0 ? TRUE : FALSE, &hfp_error);
|
||||
+ libhal_device_set_property_bool(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.can_wake_up",
|
||||
+ (cdesc->bmAttributes & UC_REMOTE_WAKEUP) != 0 ? TRUE : FALSE,
|
||||
+ &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.max_power", di.udi_power, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.num_interfaces", pcfg->num_interface, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.num_ports", di.udi_nports, &hfp_error);
|
||||
+
|
||||
+ switch (libusb20_dev_get_speed(pdev))
|
||||
+ {
|
||||
+ case LIBUSB20_SPEED_LOW:
|
||||
+ speed = 1.5;
|
||||
+ bcdspeed = 0x00150;
|
||||
+ break;
|
||||
+ case LIBUSB20_SPEED_FULL:
|
||||
+ speed = 12.0;
|
||||
+ bcdspeed = 0x01200;
|
||||
+ break;
|
||||
+ case LIBUSB20_SPEED_HIGH:
|
||||
+ speed = 480.0;
|
||||
+ bcdspeed = 0x48000;
|
||||
+ break;
|
||||
+ case LIBUSB20_SPEED_SUPER:
|
||||
+ speed = 4800.0;
|
||||
+ bcdspeed = 0x480000;
|
||||
+ break;
|
||||
+ default:
|
||||
+ ;
|
||||
+ }
|
||||
+
|
||||
+ libhal_device_set_property_double(hfp_ctx, hfp_udi, "usb_device.speed",
|
||||
+ speed, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi, "usb_device.speed_bcd",
|
||||
+ bcdspeed, &hfp_error);
|
||||
+
|
||||
+ switch (ddesc->bcdUSB)
|
||||
+ {
|
||||
+ case UD_USB_2_0:
|
||||
+ version = 2.0;
|
||||
+ break;
|
||||
+ case UD_USB_3_0:
|
||||
+ version = 3.0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ version = 1.0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ libhal_device_set_property_double(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.version", version, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.product_id", di.udi_productNo, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.vendor_id", di.udi_vendorNo, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.device_revision_bcd", ddesc->bcdUSB, &hfp_error);
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.serial", di.udi_serial, &hfp_error);
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.product", di.udi_product, &hfp_error);
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb_device.vendor", di.udi_vendor, &hfp_error);
|
||||
+
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "info.product", di.udi_product, &hfp_error);
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "info.vendor", di.udi_vendor, &hfp_error);
|
||||
+
|
||||
+ free(pcfg);
|
||||
+ }
|
||||
+end:
|
||||
+ if (pbe)
|
||||
+ libusb20_be_free(pbe);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
@@ -0,0 +1,138 @@
|
||||
--- hald/freebsd/probing/probe-usb2-interface.c.orig 2009-02-18 00:05:44.000000000 -0500
|
||||
+++ hald/freebsd/probing/probe-usb2-interface.c 2009-02-18 00:08:34.000000000 -0500
|
||||
@@ -0,0 +1,135 @@
|
||||
+/***************************************************************************
|
||||
+ * CVSID: $Id$
|
||||
+ *
|
||||
+ * probe-usb2-interface.c : USB2 Interface poller
|
||||
+ *
|
||||
+ * Copyright (C) 2009 Joe Marcus Clarke <marcus@FreeBSD.org>
|
||||
+ *
|
||||
+ * 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
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ *
|
||||
+ **************************************************************************/
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include <libusb20_desc.h>
|
||||
+#include <libusb20.h>
|
||||
+#include <dev/usb2/include/usb2_standard.h>
|
||||
+#include <dev/usb2/include/usb2_ioctl.h>
|
||||
+
|
||||
+#include "../libprobe/hfp.h"
|
||||
+
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ struct libusb20_backend *pbe = NULL;
|
||||
+ struct libusb20_device *pdev = NULL;
|
||||
+ char *busstr, *addrstr, *ifacestr;
|
||||
+ int bus, addr, iface;
|
||||
+
|
||||
+ if (! hfp_init(argc, argv))
|
||||
+ goto end;
|
||||
+
|
||||
+ pbe = libusb20_be_alloc_default();
|
||||
+ if (pbe == NULL)
|
||||
+ goto end;
|
||||
+
|
||||
+ busstr = getenv("HAL_PROP_USB_DEVICE_BUS_NUMBER");
|
||||
+ if (! busstr)
|
||||
+ goto end;
|
||||
+
|
||||
+ addrstr = getenv("HAL_PROP_USB_DEVICE_PORT_NUMBER");
|
||||
+ if (! addrstr)
|
||||
+ goto end;
|
||||
+
|
||||
+ ifacestr = getenv("HAL_PROP_USB_INTERFACE_NUMBER");
|
||||
+ if (! ifacestr)
|
||||
+ goto end;
|
||||
+
|
||||
+ bus = atoi(busstr);
|
||||
+ addr = atoi(addrstr);
|
||||
+ iface = atoi(ifacestr);
|
||||
+
|
||||
+ while ((pdev = libusb20_be_device_foreach(pbe, pdev)))
|
||||
+ {
|
||||
+ struct LIBUSB20_INTERFACE_DESC_DECODED *idesc;
|
||||
+ struct libusb20_config *pcfg = NULL;
|
||||
+ struct libusb20_interface *pif;
|
||||
+ uint8_t temp_string[256];
|
||||
+ char ifdrv[128];
|
||||
+ int curr_config;
|
||||
+
|
||||
+ if (libusb20_dev_get_bus_number(pdev) != bus ||
|
||||
+ libusb20_dev_get_address(pdev) != addr)
|
||||
+ continue;
|
||||
+
|
||||
+ if (libusb20_dev_open(pdev, 0))
|
||||
+ continue;
|
||||
+
|
||||
+ curr_config = libusb20_dev_get_config_index(pdev);
|
||||
+ pcfg = libusb20_dev_alloc_config(pdev, curr_config);
|
||||
+ if (! pcfg)
|
||||
+ continue;
|
||||
+
|
||||
+ pif = pcfg->interface + iface;
|
||||
+
|
||||
+ idesc = &pif->desc;
|
||||
+
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb.interface.class", idesc->bInterfaceClass, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb.interface.subclass", idesc->bInterfaceSubClass, &hfp_error);
|
||||
+ libhal_device_set_property_int(hfp_ctx, hfp_udi,
|
||||
+ "usb.interface.protocol", idesc->bInterfaceProtocol, &hfp_error);
|
||||
+
|
||||
+ memset(temp_string, 0, sizeof(temp_string));
|
||||
+ if (idesc->iInterface != 0)
|
||||
+ libusb20_dev_req_string_simple_sync(pdev, idesc->iInterface,
|
||||
+ temp_string, sizeof(temp_string));
|
||||
+
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb.interface.description", (char *) temp_string, &hfp_error);
|
||||
+
|
||||
+ memset(ifdrv, 0, sizeof(ifdrv));
|
||||
+ libusb20_dev_get_iface_desc(pdev, iface, ifdrv, sizeof(ifdrv));
|
||||
+ if (ifdrv[0] != '\0')
|
||||
+ {
|
||||
+ char *ifdesc;
|
||||
+
|
||||
+ ifdesc = strchr(ifdrv, ':');
|
||||
+ if (ifdesc)
|
||||
+ {
|
||||
+ *ifdesc = '\0';
|
||||
+ libhal_device_set_property_string(hfp_ctx, hfp_udi,
|
||||
+ "usb.freebsd.devname", ifdrv, &hfp_error);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ free(pcfg);
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ if (pbe)
|
||||
+ libusb20_be_free(pbe);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
@@ -1,6 +1,40 @@
|
||||
--- hald/freebsd/hf-storage.c.orig 2008-04-07 00:40:06.000000000 -0400
|
||||
+++ hald/freebsd/hf-storage.c 2008-04-07 00:40:37.000000000 -0400
|
||||
@@ -117,6 +117,7 @@ hf_storage_geom_has_partitions (const Ge
|
||||
--- hald/freebsd/hf-storage.c.orig 2008-05-07 19:23:57.000000000 -0400
|
||||
+++ hald/freebsd/hf-storage.c 2009-02-23 16:39:09.000000000 -0500
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <limits.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
+#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/disklabel.h>
|
||||
|
||||
@@ -38,6 +39,7 @@
|
||||
|
||||
#include "hf-storage.h"
|
||||
#include "hf-block.h"
|
||||
+#include "hf-devd.h"
|
||||
#include "hf-devtree.h"
|
||||
#include "hf-volume.h"
|
||||
#include "hf-util.h"
|
||||
@@ -64,7 +66,7 @@ typedef struct
|
||||
static GNode *hf_storage_geom_tree = NULL;
|
||||
static GHashTable *hf_storage_geom_hash = NULL;
|
||||
|
||||
-static void hf_storage_init_geom (void);
|
||||
+static void hf_storage_init_geom (gboolean force);
|
||||
static gboolean hf_storage_device_has_addon (HalDevice *device);
|
||||
|
||||
static void
|
||||
@@ -104,6 +106,8 @@ hf_storage_class_is_partitionable (const
|
||||
{
|
||||
return (! strcmp(geom_class, "MBR") ||
|
||||
! strcmp(geom_class, "MBREXT") ||
|
||||
+ ! strcmp(geom_class, "PART") ||
|
||||
+ ! strcmp(geom_class, "JOURNAL") ||
|
||||
! strcmp(geom_class, "GPT") ||
|
||||
! strcmp(geom_class, "APPLE") || ! strcmp(geom_class, "SUN"));
|
||||
}
|
||||
@@ -117,6 +121,7 @@ hf_storage_geom_has_partitions (const Ge
|
||||
if (g_node_n_children(node) > 0)
|
||||
return TRUE;
|
||||
|
||||
@@ -8,7 +42,7 @@
|
||||
if (hf_storage_class_is_partitionable(geom_obj->class) &&
|
||||
g_node_next_sibling(node) != NULL)
|
||||
{
|
||||
@@ -135,6 +136,7 @@ hf_storage_geom_has_partitions (const Ge
|
||||
@@ -135,6 +140,7 @@ hf_storage_geom_has_partitions (const Ge
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -16,3 +50,178 @@
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -146,6 +152,7 @@ hf_storage_geom_is_swap (const Geom_Obje
|
||||
|
||||
return (! strcmp(geom_obj->class, "BSD") && geom_obj->type == FS_SWAP)
|
||||
|| ((! strcmp(geom_obj->class, "MBR") ||
|
||||
+ ! strcmp(geom_obj->class, "PART") ||
|
||||
! strcmp(geom_obj->class, "MBREXT"))
|
||||
&& (geom_obj->type == 0x18 /* AST Windows swapfile */
|
||||
|| geom_obj->type == 0x42 /* SFS or Linux swap */
|
||||
@@ -294,7 +301,7 @@ hf_storage_device_probe (HalDevice *devi
|
||||
{
|
||||
g_return_if_fail(HAL_IS_DEVICE(device));
|
||||
|
||||
- hf_storage_init_geom();
|
||||
+ hf_storage_init_geom(TRUE);
|
||||
|
||||
if (hf_runner_run_sync(device, 0, "hald-probe-storage",
|
||||
"HF_HAS_CHILDREN", HF_BOOL_TO_STRING(hf_storage_device_has_partitions(device)),
|
||||
@@ -433,6 +440,29 @@ hf_storage_parse_conftxt (const char *co
|
||||
if (! strcmp (geom_obj->class, "GPT") ||
|
||||
! strcmp (geom_obj->class, "APPLE"))
|
||||
geom_obj->str_type = g_strdup(fields[10]);
|
||||
+ else if (! strcmp (geom_obj->class, "PART"))
|
||||
+ {
|
||||
+ if (g_strv_length(fields) >= 15)
|
||||
+ {
|
||||
+ if (! strcmp(fields[13], "xt"))
|
||||
+ {
|
||||
+ geom_obj->type = atoi(fields[14]);
|
||||
+ if (! strcmp(fields[11], "xs"))
|
||||
+ {
|
||||
+ g_free(geom_obj->class);
|
||||
+ geom_obj->class = g_strdup(fields[12]);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else if (fields[10][0] == '!')
|
||||
+ {
|
||||
+ char *nottype;
|
||||
+
|
||||
+ nottype = fields[10];
|
||||
+ nottype++;
|
||||
+ geom_obj->type = atoi(nottype);
|
||||
+ }
|
||||
else
|
||||
geom_obj->type = atoi(fields[10]);
|
||||
}
|
||||
@@ -540,16 +570,34 @@ hf_storage_device_rescan_real (HalDevice
|
||||
hf_storage_device_probe(device, TRUE);
|
||||
}
|
||||
|
||||
+#if __FreeBSD_version < 700110
|
||||
static gboolean
|
||||
hf_storage_conftxt_timeout_cb (gpointer data)
|
||||
{
|
||||
+ if (hf_is_waiting)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ hf_storage_devd_notify("DEVFS", "CDEV", "CREATE", NULL);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static gboolean
|
||||
+hf_storage_devd_notify (const char *system,
|
||||
+ const char *subsystem,
|
||||
+ const char *type,
|
||||
+ const char *data)
|
||||
+{
|
||||
static GSList *disks = NULL;
|
||||
static gboolean first = TRUE;
|
||||
+ gboolean handled = FALSE;
|
||||
char *conftxt;
|
||||
GSList *new_disks;
|
||||
|
||||
- if (hf_is_waiting)
|
||||
- return TRUE;
|
||||
+ if (strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") ||
|
||||
+ (strcmp(type, "CREATE") && strcmp(type, "DESTROY")))
|
||||
+ return FALSE;
|
||||
|
||||
conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt");
|
||||
new_disks = hf_storage_parse_conftxt(conftxt);
|
||||
@@ -572,6 +620,7 @@ hf_storage_conftxt_timeout_cb (gpointer
|
||||
if (! hf_storage_find_disk(disks, disk->name))
|
||||
{
|
||||
osspec_probe(); /* catch new disk(s) */
|
||||
+ handled = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -593,7 +642,10 @@ hf_storage_conftxt_timeout_cb (gpointer
|
||||
device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
|
||||
if (device && hal_device_has_capability(device, "storage") &&
|
||||
! hf_storage_device_has_addon(device))
|
||||
- hf_storage_device_rescan_real(device);
|
||||
+ {
|
||||
+ hf_storage_device_rescan_real(device);
|
||||
+ handled = TRUE;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -601,7 +653,10 @@ hf_storage_conftxt_timeout_cb (gpointer
|
||||
/* disk removed */
|
||||
device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
|
||||
if (device && hal_device_has_capability(device, "storage"))
|
||||
- hf_device_remove_tree(device);
|
||||
+ {
|
||||
+ hf_device_remove_tree(device);
|
||||
+ handled = TRUE;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,17 +665,17 @@ hf_storage_conftxt_timeout_cb (gpointer
|
||||
g_slist_free(disks);
|
||||
disks = new_disks;
|
||||
|
||||
- return TRUE;
|
||||
+ return handled;
|
||||
}
|
||||
|
||||
static void
|
||||
-hf_storage_init_geom (void)
|
||||
+hf_storage_init_geom (gboolean force)
|
||||
{
|
||||
char *conftxt;
|
||||
static gboolean inited = FALSE;
|
||||
GSList *disks;
|
||||
|
||||
- if (inited)
|
||||
+ if (inited && ! force)
|
||||
return;
|
||||
|
||||
conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt");
|
||||
@@ -636,8 +691,10 @@ hf_storage_init_geom (void)
|
||||
static void
|
||||
hf_storage_init (void)
|
||||
{
|
||||
- hf_storage_init_geom();
|
||||
+ hf_storage_init_geom(FALSE);
|
||||
+#if __FreeBSD_version < 700110
|
||||
g_timeout_add(3000, hf_storage_conftxt_timeout_cb, NULL);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -720,8 +777,6 @@ hf_storage_device_add (HalDevice *device
|
||||
{
|
||||
g_return_if_fail(HAL_IS_DEVICE(device));
|
||||
|
||||
- hf_storage_init_geom();
|
||||
-
|
||||
if (hf_device_preprobe(device))
|
||||
{
|
||||
hf_storage_device_probe(device, FALSE);
|
||||
@@ -739,7 +794,7 @@ hf_storage_get_geoms (const char *devnam
|
||||
|
||||
g_return_val_if_fail(devname != NULL, NULL);
|
||||
|
||||
- hf_storage_init_geom();
|
||||
+ hf_storage_init_geom(FALSE);
|
||||
|
||||
hash = g_str_hash(devname);
|
||||
node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL,
|
||||
@@ -802,3 +857,7 @@ HFHandler hf_storage_handler = {
|
||||
.probe = hf_storage_probe,
|
||||
.device_rescan = hf_storage_device_rescan
|
||||
};
|
||||
+
|
||||
+HFDevdHandler hf_storage_devd_handler = {
|
||||
+ .notify = hf_storage_devd_notify
|
||||
+};
|
||||
|
||||
Reference in New Issue
Block a user