Date: Fri, 27 Jul 2007 12:20:50 -0600 From: "Kirk Davis" <kirk.davis@epsb.ca> To: <freebsd-usb@freebsd.org> Subject: Changing the poer on a USB device Message-ID: <DB9A31C316524A4A83E54A2C0D2065570413BC74@Exchange24.EDU.epsb.ca>
next in thread | raw e-mail | index | archive | help
Hi, 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 usb_control_msg. Thanks, Kirk =09 Kirk Davis Sr. Network Analyst, ITS Edmonton Public Schools =20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DB9A31C316524A4A83E54A2C0D2065570413BC74>