Changing the poer on a USB device

Kirk Davis kirk.davis at
Fri Jul 27 18:32:51 UTC 2007

	I am trying to write a device driver for FreeBSD that will
detect and change a newer blackberry. I have the driver detecting and
enabling the port when I insert the blackberry but it only configs the
USB port for 100mA rate.  The blackberry needs 500mA and it displays
some information on the blackberry screen that they current is to low.

	Looking at some other code that was written for libusb it looks
like that is what is needed to turn on the charging:

void charge(struct usb_dev_handle *handle)
	// the special sauce... these steps seem to do the trick
	// for the 7750 series... needs testing on others
	char buffer[2];
	usb_control_msg(handle, 0xc0, 0xa5, 0, 1, buffer, 2, 100);
	usb_control_msg(handle, 0x40, 0xa2, 0, 1, buffer, 0, 100);

	I'm a weak C programmer and this is my first attempt at a
driver.  Can anyone give my some advise on how I would do something like
this in a driver?  I'm not sure of the kernel equivalent to

Thanks,  Kirk


Kirk Davis
Sr. Network Analyst, ITS
Edmonton Public Schools

More information about the freebsd-usb mailing list