Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Hans Petter Selasky
On Thursday 02 July 2009 16:52:49 Lawrence Stewart wrote:
 Hans Petter Selasky wrote:
  See attachment.
  --HPS

 Any chance you (or someone with the right clue) could update this patch
 to work with more recent 8-CURRENT? I get the following output when
 trying to compile kdebase4 (which applies your original patch as
 extra-patch-libusb20) on r195046 world/kernel:


 Scanning dependencies of target kcm_usb

 [ 67%] Building CXX object
 apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
 [ 67%] Building CXX object
 apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
 In file included from
 /usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevi
ces.h:20,



Hi,

It looks like you have two set of header files. Second, change the USB dev/  
header files to:

#  include dev/usb/usb.h
#  include dev/usb/usbdi.h

Else there are no further changes.

--HPS
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Jeremy Messenger
On Thu, 02 Jul 2009 09:52:49 -0500, Lawrence Stewart  
lstew...@freebsd.org wrote:



Hans Petter Selasky wrote:

See attachment.
--HPS


Any chance you (or someone with the right clue) could update this patch  
to work with more recent 8-CURRENT? I get the following output when  
trying to compile kdebase4 (which applies your original patch as  
extra-patch-libusb20) on r195046 world/kernel:


There is no usb_revision.h in recently -CURRENT. I have nothing of it in  
my system, I always run make delete-old and delete-old-libs. However, I am  
able to installed both kdebase3 and kdebase4 by tweak in  
extra-patch-libusb20. All I have to do like this:


Change from:

+#include dev/usb/usb_revision.h

To:

+/*#include dev/usb/usb_revision.h*/

As for the kdebase3, I just took a patch from ports/135860 then tweak a  
bit. I am planning to follow up in its PR.


But, I haven't run those in runtime yet thought.

Cheers,
Mezz


Scanning dependencies of target kcm_usb [ 67%] Building CXX object  
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
[ 67%] Building CXX object  
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
In file included from  
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.h:20,  
   from  
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/kcmusb.cpp:27:  
 /usr/include/dev/usb/usb_revision.h:33: error: multiple definition of  
'enum usb_dev_speed'
/usr/include/dev/usb/usb.h:686: error: previous definition here  
/usr/include/dev/usb/usb_revision.h:34: error: conflicting declaration  
'USB_SPEED_VARIABLE'
/usr/include/dev/usb/usb.h:687: error: 'USB_SPEED_VARIABLE' has a  
previous declaration as 'usb_dev_speed USB_SPEED_VARIABLE'  
/usr/include/dev/usb/usb_revision.h:35: error: conflicting declaration  
'USB_SPEED_LOW'
/usr/include/dev/usb/usb.h:688: error: 'USB_SPEED_LOW' has a previous  
declaration as 'usb_dev_speed USB_SPEED_LOW'  
/usr/include/dev/usb/usb_revision.h:36: error: conflicting declaration  
'USB_SPEED_FULL'
/usr/include/dev/usb/usb.h:689: error: 'USB_SPEED_FULL' has a previous  
declaration as 'usb_dev_speed USB_SPEED_FULL'  
/usr/include/dev/usb/usb_revision.h:37: error: conflicting declaration  
'USB_SPEED_HIGH'
/usr/include/dev/usb/usb.h:690: error: 'USB_SPEED_HIGH' has a previous  
declaration as 'usb_dev_speed USB_SPEED_HIGH'  
/usr/include/dev/usb/usb_revision.h:38: error: conflicting declaration  
'USB_SPEED_SUPER'
/usr/include/dev/usb/usb.h:691: error: 'USB_SPEED_SUPER' has a previous  
declaration as 'usb_dev_speed USB_SPEED_SUPER'  
/usr/include/dev/usb/usb_revision.h:45: error: multiple definition of  
'enum usb_revision'
/usr/include/dev/usb/usb.h:698: error: previous definition here  
/usr/include/dev/usb/usb_revision.h:46: error: conflicting declaration  
'USB_REV_UNKNOWN'
/usr/include/dev/usb/usb.h:699: error: 'USB_REV_UNKNOWN' has a previous  
declaration as 'usb_revision USB_REV_UNKNOWN'  
/usr/include/dev/usb/usb_revision.h:47: error: conflicting declaration  
'USB_REV_PRE_1_0'
/usr/include/dev/usb/usb.h:700: error: 'USB_REV_PRE_1_0' has a previous  
declaration as 'usb_revision USB_REV_PRE_1_0'  
/usr/include/dev/usb/usb_revision.h:48: error: conflicting declaration  
'USB_REV_1_0'
/usr/include/dev/usb/usb.h:701: error: 'USB_REV_1_0' has a previous  
declaration as 'usb_revision USB_REV_1_0'  
/usr/include/dev/usb/usb_revision.h:49: error: conflicting declaration  
'USB_REV_1_1'
/usr/include/dev/usb/usb.h:702: error: 'USB_REV_1_1' has a previous  
declaration as 'usb_revision USB_REV_1_1'  
/usr/include/dev/usb/usb_revision.h:50: error: conflicting declaration  
'USB_REV_2_0'
/usr/include/dev/usb/usb.h:703: error: 'USB_REV_2_0' has a previous  
declaration as 'usb_revision USB_REV_2_0'  
/usr/include/dev/usb/usb_revision.h:51: error: conflicting declaration  
'USB_REV_2_5'
/usr/include/dev/usb/usb.h:704: error: 'USB_REV_2_5' has a previous  
declaration as 'usb_revision USB_REV_2_5'  
/usr/include/dev/usb/usb_revision.h:52: error: conflicting declaration  
'USB_REV_3_0'
/usr/include/dev/usb/usb.h:705: error: 'USB_REV_3_0' has a previous  
declaration as 'usb_revision USB_REV_3_0'  
/usr/include/dev/usb/usb_revision.h:59: error: multiple definition of  
'enum usb_hc_mode'
/usr/include/dev/usb/usb.h:712: error: previous definition here  
/usr/include/dev/usb/usb_revision.h:60: error: conflicting declaration  
'USB_MODE_HOST'
/usr/include/dev/usb/usb.h:713: error: 'USB_MODE_HOST' has a previous  
declaration as 'usb_hc_mode USB_MODE_HOST'  
/usr/include/dev/usb/usb_revision.h:61: error: conflicting declaration  
'USB_MODE_DEVICE'
/usr/include/dev/usb/usb.h:714: error: 'USB_MODE_DEVICE' has a previous  
declaration as 'usb_hc_mode USB_MODE_DEVICE'  
/usr/include/dev/usb/usb_revision.h:62: error: conflicting declaration  
'USB_MODE_DUAL'
/usr/include/dev/usb/usb.h:715: error: 'USB_MODE_DUAL' has a previous  
declaration as 'usb_hc_mode USB_MODE_DUAL'  

Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Lawrence Stewart

Hans Petter Selasky wrote:

On Thursday 02 July 2009 16:52:49 Lawrence Stewart wrote:

Hans Petter Selasky wrote:

See attachment.
--HPS

Any chance you (or someone with the right clue) could update this patch
to work with more recent 8-CURRENT? I get the following output when
trying to compile kdebase4 (which applies your original patch as
extra-patch-libusb20) on r195046 world/kernel:


Scanning dependencies of target kcm_usb

[ 67%] Building CXX object
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
[ 67%] Building CXX object
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
In file included from
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevi
ces.h:20,




Hi,

It looks like you have two set of header files. Second, change the USB dev/  
header files to:


#  include dev/usb/usb.h
#  include dev/usb/usbdi.h

Else there are no further changes.


ah ha, had forgotten to run make delete-old after last update. Thanks 
for the hint and thanks for the include fix. Trying it out now.


Cheers,
Lawrence
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Lawrence Stewart

Hans Petter Selasky wrote:

See attachment.
--HPS


Any chance you (or someone with the right clue) could update this patch 
to work with more recent 8-CURRENT? I get the following output when 
trying to compile kdebase4 (which applies your original patch as 
extra-patch-libusb20) on r195046 world/kernel:



Scanning dependencies of target kcm_usb 

[ 67%] Building CXX object 
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
[ 67%] Building CXX object 
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
In file included from 
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.h:20, 



 from 
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/kcmusb.cpp:27: 



/usr/include/dev/usb/usb_revision.h:33: error: multiple definition of 
'enum usb_dev_speed'
/usr/include/dev/usb/usb.h:686: error: previous definition here 

/usr/include/dev/usb/usb_revision.h:34: error: conflicting declaration 
'USB_SPEED_VARIABLE'
/usr/include/dev/usb/usb.h:687: error: 'USB_SPEED_VARIABLE' has a 
previous declaration as 'usb_dev_speed USB_SPEED_VARIABLE' 

/usr/include/dev/usb/usb_revision.h:35: error: conflicting declaration 
'USB_SPEED_LOW'
/usr/include/dev/usb/usb.h:688: error: 'USB_SPEED_LOW' has a previous 
declaration as 'usb_dev_speed USB_SPEED_LOW' 

/usr/include/dev/usb/usb_revision.h:36: error: conflicting declaration 
'USB_SPEED_FULL'
/usr/include/dev/usb/usb.h:689: error: 'USB_SPEED_FULL' has a previous 
declaration as 'usb_dev_speed USB_SPEED_FULL' 

/usr/include/dev/usb/usb_revision.h:37: error: conflicting declaration 
'USB_SPEED_HIGH'
/usr/include/dev/usb/usb.h:690: error: 'USB_SPEED_HIGH' has a previous 
declaration as 'usb_dev_speed USB_SPEED_HIGH' 

/usr/include/dev/usb/usb_revision.h:38: error: conflicting declaration 
'USB_SPEED_SUPER'
/usr/include/dev/usb/usb.h:691: error: 'USB_SPEED_SUPER' has a previous 
declaration as 'usb_dev_speed USB_SPEED_SUPER' 

/usr/include/dev/usb/usb_revision.h:45: error: multiple definition of 
'enum usb_revision'
/usr/include/dev/usb/usb.h:698: error: previous definition here 

/usr/include/dev/usb/usb_revision.h:46: error: conflicting declaration 
'USB_REV_UNKNOWN'
/usr/include/dev/usb/usb.h:699: error: 'USB_REV_UNKNOWN' has a previous 
declaration as 'usb_revision USB_REV_UNKNOWN' 

/usr/include/dev/usb/usb_revision.h:47: error: conflicting declaration 
'USB_REV_PRE_1_0'
/usr/include/dev/usb/usb.h:700: error: 'USB_REV_PRE_1_0' has a previous 
declaration as 'usb_revision USB_REV_PRE_1_0' 

/usr/include/dev/usb/usb_revision.h:48: error: conflicting declaration 
'USB_REV_1_0'
/usr/include/dev/usb/usb.h:701: error: 'USB_REV_1_0' has a previous 
declaration as 'usb_revision USB_REV_1_0' 

/usr/include/dev/usb/usb_revision.h:49: error: conflicting declaration 
'USB_REV_1_1'
/usr/include/dev/usb/usb.h:702: error: 'USB_REV_1_1' has a previous 
declaration as 'usb_revision USB_REV_1_1' 

/usr/include/dev/usb/usb_revision.h:50: error: conflicting declaration 
'USB_REV_2_0'
/usr/include/dev/usb/usb.h:703: error: 'USB_REV_2_0' has a previous 
declaration as 'usb_revision USB_REV_2_0' 

/usr/include/dev/usb/usb_revision.h:51: error: conflicting declaration 
'USB_REV_2_5'
/usr/include/dev/usb/usb.h:704: error: 'USB_REV_2_5' has a previous 
declaration as 'usb_revision USB_REV_2_5' 

/usr/include/dev/usb/usb_revision.h:52: error: conflicting declaration 
'USB_REV_3_0'
/usr/include/dev/usb/usb.h:705: error: 'USB_REV_3_0' has a previous 
declaration as 'usb_revision USB_REV_3_0' 

/usr/include/dev/usb/usb_revision.h:59: error: multiple definition of 
'enum usb_hc_mode'
/usr/include/dev/usb/usb.h:712: error: previous definition here 

/usr/include/dev/usb/usb_revision.h:60: error: conflicting declaration 
'USB_MODE_HOST'
/usr/include/dev/usb/usb.h:713: error: 'USB_MODE_HOST' has a previous 
declaration as 'usb_hc_mode USB_MODE_HOST' 

/usr/include/dev/usb/usb_revision.h:61: error: conflicting declaration 
'USB_MODE_DEVICE'
/usr/include/dev/usb/usb.h:714: error: 'USB_MODE_DEVICE' has a previous 
declaration as 'usb_hc_mode USB_MODE_DEVICE' 

/usr/include/dev/usb/usb_revision.h:62: error: conflicting declaration 
'USB_MODE_DUAL'
/usr/include/dev/usb/usb.h:715: error: 'USB_MODE_DUAL' has a previous 
declaration as 'usb_hc_mode USB_MODE_DUAL' 

/usr/include/dev/usb/usb_revision.h:69: error: multiple definition of 
'enum usb_dev_state'
/usr/include/dev/usb/usb.h:722: error: previous definition here 

/usr/include/dev/usb/usb_revision.h:70: error: conflicting declaration 
'USB_STATE_DETACHED'
/usr/include/dev/usb/usb.h:723: error: 'USB_STATE_DETACHED' has a 
previous declaration as 'usb_dev_state USB_STATE_DETACHED' 

/usr/include/dev/usb/usb_revision.h:71: error: conflicting declaration 
'USB_STATE_ATTACHED'
/usr/include/dev/usb/usb.h:724: error: 'USB_STATE_ATTACHED' has a 
previous declaration as 'usb_dev_state USB_STATE_ATTACHED' 

/usr/include/dev/usb/usb_revision.h:72: error: conflicting declaration 

Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Lawrence Stewart

[trimmed CC list]

Lawrence Stewart wrote:

Hans Petter Selasky wrote:

On Thursday 02 July 2009 16:52:49 Lawrence Stewart wrote:

Hans Petter Selasky wrote:

See attachment.
--HPS

Any chance you (or someone with the right clue) could update this patch
to work with more recent 8-CURRENT? I get the following output when
trying to compile kdebase4 (which applies your original patch as
extra-patch-libusb20) on r195046 world/kernel:


Scanning dependencies of target kcm_usb

[ 67%] Building CXX object
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
[ 67%] Building CXX object
apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
In file included from
/usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevi 


ces.h:20,




Hi,

It looks like you have two set of header files. Second, change the USB 
dev/  header files to:


#  include dev/usb/usb.h
#  include dev/usb/usbdi.h

Else there are no further changes.


ah ha, had forgotten to run make delete-old after last update. Thanks 
for the hint and thanks for the include fix. Trying it out now.



FYI, Hans your suggestion didn't work. Jeremy's on the other hand did. 
By only including dev/usb/usb_ioctl.h the compile finishes without issue.


I'm in the process of updating to today's current though and a lot of 
USB related changes were in the changeset so it's entirely possible 
running new kernel/world will make your comments valid.


Cheers,
Lawrence
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Temporary patch to fix USB in kdebase4

2009-07-02 Thread Hans Petter Selasky
On Thursday 02 July 2009 17:58:01 Lawrence Stewart wrote:
 [trimmed CC list]

 Lawrence Stewart wrote:
  Hans Petter Selasky wrote:
  On Thursday 02 July 2009 16:52:49 Lawrence Stewart wrote:
  Hans Petter Selasky wrote:
  See attachment.
  --HPS
 
  Any chance you (or someone with the right clue) could update this patch
  to work with more recent 8-CURRENT? I get the following output when
  trying to compile kdebase4 (which applies your original patch as
  extra-patch-libusb20) on r195046 world/kernel:
 
 
  Scanning dependencies of target kcm_usb
 
  [ 67%] Building CXX object
  apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcm_usb_automoc.o
  [ 67%] Building CXX object
  apps/kinfocenter/usbview/CMakeFiles/kcm_usb.dir/kcmusb.o
  In file included from
  /usr/ports/x11/kdebase4/work/kdebase-4.2.4/apps/kinfocenter/usbview/usb
 devi
 
  ces.h:20,
 
  Hi,
 
  It looks like you have two set of header files. Second, change the USB
  dev/  header files to:
 
  #  include dev/usb/usb.h
  #  include dev/usb/usbdi.h
 
  Else there are no further changes.
 
  ah ha, had forgotten to run make delete-old after last update. Thanks
  for the hint and thanks for the include fix. Trying it out now.

 FYI, Hans your suggestion didn't work. Jeremy's on the other hand did.
 By only including dev/usb/usb_ioctl.h the compile finishes without issue.


Thinking about it you might be right. The files I mentioned are only used for 
kernel drivers, not userland. 

 I'm in the process of updating to today's current though and a lot of
 USB related changes were in the changeset so it's entirely possible
 running new kernel/world will make your comments valid.


Glad you found out what was wrong. 

--HPS

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Temporary patch to fix USB in kdebase4

2009-06-08 Thread Hans Petter Selasky
See attachment.
--HPS
diff -u -r work.old/kdebase-4.2.4/apps/kinfocenter/usbview/CMakeLists.txt work/kdebase-4.2.4/apps/kinfocenter/usbview/CMakeLists.txt
--- work.old/kdebase-4.2.4/apps/kinfocenter/usbview/CMakeLists.txt	2009-06-07 10:54:55.0 +0200
+++ work/kdebase-4.2.4/apps/kinfocenter/usbview/CMakeLists.txt	2009-06-07 10:55:58.0 +0200
@@ -9,7 +9,7 @@
 kde4_add_plugin(kcm_usb ${kcm_usb_PART_SRCS})
 
 
-target_link_libraries(kcm_usb  ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY})
+target_link_libraries(kcm_usb  ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} -lusb)
 
 install(TARGETS kcm_usb  DESTINATION ${PLUGIN_INSTALL_DIR} )
 
diff -u -r work.old/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.cpp work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.cpp
--- work.old/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.cpp	2009-06-07 10:54:55.0 +0200
+++ work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.cpp	2009-06-07 10:55:58.0 +0200
@@ -294,17 +294,25 @@
 
 /*
  * FreeBSD support by Markus Brueffer mar...@brueffer.de
+ * libusb20 support by Hans Petter Selasky hsela...@freebsd.org
  *
  * Basic idea and some code fragments were taken from FreeBSD's usbdevs(8),
  * originally developed for NetBSD, so this code should work with no or
  * only little modification on NetBSD.
  */
 
-void USBDevice::collectData( int fd, int level, usb_device_info di, int parent)
+void USBDevice::collectData(struct libusb20_backend *pbe,
+struct libusb20_device *pdev)
 {
+	char tempbuf[32];
+	struct usb_device_info di;
+
+	if (libusb20_dev_get_info(pdev, di))
+		memset(di, 0, sizeof(di));
+
 	// determine data for this device
-	_level = level;
-	_parent = parent;
+	_level = 0;
+	_parent = 0;
 
 	_bus = di.udi_bus;
 	_device = di.udi_addr;
@@ -320,88 +328,47 @@
 	_power = di.udi_power;
 	_channels = di.udi_nports;
 
-	// determine the speed
-#if defined(__DragonFly__) || (defined(Q_OS_FREEBSD)  __FreeBSD_version  490102) || defined(Q_OS_NETBSD)
 	switch (di.udi_speed) {
 		case USB_SPEED_LOW: _speed = 1.5; break;
 		case USB_SPEED_FULL: _speed = 12.0; break;
 		case USB_SPEED_HIGH: _speed = 480.0; break;
+		case USB_SPEED_VARIABLE: _speed = 480.0; break;
+		case USB_SPEED_SUPER: _speed = 4800.0; break;
+		default: _speed = 480.0; break;
 	}
-#else
-	_speed = di.udi_lowspeed ? 1.5 : 12.0;
-#endif
 
 	// Get all attached devicenodes
-	for ( int i = 0; i  USB_MAX_DEVNAMES; ++i )
-	if ( di.udi_devnames[i][0] )
-	_devnodes  di.udi_devnames[i];
+	for ( int i = 0; i  32; ++i ) {
+	  if (libusb20_dev_get_iface_desc(
+	  pdev, i, tempbuf, sizeof(tempbuf)) == 0) {
+		_devnodes  tempbuf;
+	  } else {
+	  break;
+	  }
+	}
 
 	// For compatibility, split the revision number
 	sscanf( di.udi_release, %x.%x, _revMajor, _revMinor );
-
-	// Cycle through the attached devices if there are any
-	for ( int p = 0; p  di.udi_nports; ++p ) {
-		// Get data for device
-		struct usb_device_info di2;
-
-		di2.udi_addr = di.udi_ports[p];
-
-		if ( di2.udi_addr = USB_MAX_DEVICES )
-		continue;
-
-		if ( ioctl(fd, USB_DEVICEINFO, di2) == -1 )
-		continue;
-
-		// Only add the device if we didn't detect it, yet
-		if (!find( di2.udi_bus, di2.udi_addr ) )
-		{
-			USBDevice *device = new USBDevice();
-			device-collectData( fd, level + 1, di2, di.udi_addr );
-		}
-	}
 }
 
 bool USBDevice::parse(const QString fname)
 {
 	static bool showErrorMessage = true;
-	bool error = false;
+	struct libusb20_backend *pbe;
+	struct libusb20_device *pdev;
 	_devices.clear();
 
-	QFile controller(/dev/usb0);
-	int i = 1;
-	while ( controller.exists() )
-	{
-		// If the devicenode exists, continue with further inspection
-		if ( controller.open(QIODevice::ReadOnly) )
-		{
-			for ( int addr = 1; addr  USB_MAX_DEVICES; ++addr )
-			{
-struct usb_device_info di;
-
-di.udi_addr = addr;
-if ( ioctl(controller.handle(), USB_DEVICEINFO, di) != -1 )
-{
-	if (!find( di.udi_bus, di.udi_addr ) )
-	{
-		USBDevice *device = new USBDevice();
-		device-collectData( controller.handle(), 0, di, 0);
-	}
-}
-			}
-			controller.close();
-#ifndef Q_OS_NETBSD
-		} else {
-			error = true;
-#endif
-		}
-		controller.setFileName( QString::fromLocal8Bit(/dev/usb%1).arg(i++) );
+	pbe = libusb20_be_alloc_default();
+	if (pbe == NULL)
+		return (false);
+
+	pdev = NULL;
+
+	while ((pdev = libusb20_be_device_foreach(pbe, pdev))) {
+		USBDevice *device = new USBDevice();
+		device-collectData(pbe, pdev);
 	}
-
-	if ( showErrorMessage  error ) {
-		showErrorMessage = false;
-		KMessageBox::error( 0, i18n(Could not open one or more USB controller. Make sure, you have read access to all USB controllers that should be listed here.));
-	}
-
+	libusb20_be_free(pbe);
 	return true;
 }
 #endif
diff -u -r work.old/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.h work/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.h
--- work.old/kdebase-4.2.4/apps/kinfocenter/usbview/usbdevices.h	2009-06-07 10:54:55.0 +0200
+++