Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jan 2008 10:15:16 -0500
From:      Mikhail Teterin <mi+kde@aldan.algebra.com>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        johnjen@reynoldsnet.org, R.Tobin@ed.ac.uk, usb@FreeBSD.org
Subject:   BlackBerry (Re: using libusb)
Message-ID:  <200801091015.17730@aldan>
In-Reply-To: <200801090114.56195@aldan>
References:  <200801090114.56195@aldan>

next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_FUOhHWvBFPpc6Lx
Content-Type: text/plain;
  charset="koi8-u"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

= I'm trying to port a suit called "barry", which provides a library and some
= utilities to work with RIM's BlackBerry devices.

= It compiles cleanly, but fails to find a connected device at run time. In 
= fact, it fails to find _any_ devices, even though ``usbdevs -v'' lists 
= several including the BlackBerry

Ok, I see, what's happening... The current implementation of libusb's BSD 
support (bsd.c) ignores all devices other than ``ugen'':

    if (strncmp(di.udi_devnames[0], "ugen", 4) != 0) {
      /* best not to play with things we don't understand */
      continue;

And BlackBerry is identified as ``umass'' here :(

Not sure, how best to solve this -- commenting out the above-quoted "if" 
simply leads to a failure later, because the code will look for /dev/umassX, 
which simply would not exist -- umass0 is da3 here. But it might be da0 
somewhere else, and there is no way to know, which is which :-(

But even if one could figure this out and specify the device to the tool 
explicitly, daX will not understand ugen's ioctls anyway...

What a retarded mess...

We really need the low-level (ugen?) interfaces available for all 
USB-devices -- even those, which are /also/ handled by higher-level 
interfaces (like ulpt, uscan, umass). As things stand, the higher-level ones 
are "greedy" and will prevent ugen from appearing, even if one wanted to.

Their names may reflect their additional capabilities (ulpt may also print, 
uscan may also scan) but they must all understand ugen's ioctls.

The only work-around is to not have umass, etcaetera in your kernel, but that 
sucks, because one may want to be able to access /some/ devices as 
mass-storage, and some others as merely generics...

Hans, any hope? Thank you!

	-mi

--Boundary-00=_FUOhHWvBFPpc6Lx
Content-Type: text/plain;
  charset="koi8-u";
  name="barry.shar"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="barry.shar"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	barry/Makefile
#	barry/distinfo
#	barry/pkg-descr
#	barry/pkg-plist
#
echo x - barry/Makefile
sed 's/^X//' >barry/Makefile << 'END-of-barry/Makefile'
X## ports collection makefile for:	barry
X# Date created:		2 January 2008
X# Whom:			mi
X#
X# $FreeBSD$
X#
X
XPORTNAME=	barry
XPORTVERSION=	0.11
XCATEGORIES=	comms
XMASTER_SITES=	SF
XMASTER_SITE_SUBDIR=	${PORTNAME}
X
XMAINTAINER=	mi@aldan.algebra.com
XCOMMENT=	Library/tools for interacty with RIM BlackBerry
X
XOPTIONS=	GUI	"Build Barry's GUI"	on
XLIB_DEPENDS=	usb:${PORTSDIR}/devel/libusb
X
XUSE_BZIP2=	yes
XGNU_CONFIGURE=	yes
XUSE_OPENSSL=	yes
XCONFIGURE_ENV=	OPENSSL_CFLAGS="${OPENSSL_CFLAGS}"	\
X		OPENSSL_LIBS="${OPENSSL_LDFLAGS} -lcrypto -lssl"
XALL_TARGET=	-j`${SYSCTL} -n hw.ncpu`
X
XMAN1=	bcharge.1 bidentify.1 btool.1
X
X.include <bsd.port.pre.mk>
X
X.if defined(WITHOUT_GUI)
XCONFIGURE_ARGS+=	--without-gui
X.else
XCONFIGURE_ARGS+=	--with-gui
X.endif
X
X.include <bsd.port.post.mk>
END-of-barry/Makefile
echo x - barry/distinfo
sed 's/^X//' >barry/distinfo << 'END-of-barry/distinfo'
XMD5 (barry-0.11.tar.bz2) = a42db74aa7f900958d5d2a527b55f50c
XSHA256 (barry-0.11.tar.bz2) = ee0febf16239e1aa61656c9d508907717c5b8d5eb62416de608fce92574c06ee
XSIZE (barry-0.11.tar.bz2) = 867296
END-of-barry/distinfo
echo x - barry/pkg-descr
sed 's/^X//' >barry/pkg-descr << 'END-of-barry/pkg-descr'
XBarry is an Open Source application that will allow synchronization,
Xbackup, restore and program management for BlackBerry(TM) devices.
X
XWWW: http://www.netdirect.ca/software/packages/barry/
END-of-barry/pkg-descr
echo x - barry/pkg-plist
sed 's/^X//' >barry/pkg-plist << 'END-of-barry/pkg-plist'
Xbin/bidentify
Xbin/bktrans
Xbin/btool
Xbin/btranslate
Xbin/upldif
Xinclude/barry/barry.h
Xinclude/barry/builder.h
Xinclude/barry/common.h
Xinclude/barry/controller.h
Xinclude/barry/controllertmpl.h
Xinclude/barry/data.h
Xinclude/barry/error.h
Xinclude/barry/ldif.h
Xinclude/barry/parser.h
Xinclude/barry/probe.h
Xinclude/barry/protocol.h
Xinclude/barry/r_calendar.h
Xinclude/barry/r_contact.h
Xinclude/barry/r_folder.h
Xinclude/barry/r_memo.h
Xinclude/barry/r_message.h
Xinclude/barry/r_pin_message.h
Xinclude/barry/r_saved_message.h
Xinclude/barry/r_servicebook.h
Xinclude/barry/r_task.h
Xinclude/barry/record.h
Xinclude/barry/s11n-boost.h
Xinclude/barry/socket.h
Xinclude/barry/time.h
Xinclude/barry/usbwrap.h
Xinclude/barry/version.h
X@dirrm include/barry
Xlib/pkgconfig/libbarry-0.pc
Xsbin/bcharge
Xsbin/breset
Xsbin/pppob
END-of-barry/pkg-plist
exit

--Boundary-00=_FUOhHWvBFPpc6Lx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801091015.17730>