From owner-freebsd-usb@FreeBSD.ORG Fri Jul 27 18:32:51 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CEB16A41A for ; Fri, 27 Jul 2007 18:32:51 +0000 (UTC) (envelope-from kirk.davis@epsb.ca) Received: from Exchange22.EDU.epsb.ca (exchange22.edu.epsb.ca [198.161.119.187]) by mx1.freebsd.org (Postfix) with ESMTP id 90A9213C467 for ; Fri, 27 Jul 2007 18:32:51 +0000 (UTC) (envelope-from kirk.davis@epsb.ca) Received: from Exchange24.EDU.epsb.ca ([10.0.5.121]) by Exchange22.EDU.epsb.ca with Microsoft SMTPSVC(6.0.3790.1830); Fri, 27 Jul 2007 12:20:50 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 27 Jul 2007 12:20:50 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Changing the poer on a USB device Thread-Index: AcfQetwdwV0ht7FNRpqltfabltWgUg== From: "Kirk Davis" To: X-OriginalArrivalTime: 27 Jul 2007 18:20:50.0150 (UTC) FILETIME=[DC275060:01C7D07A] Subject: Changing the poer on a USB device X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 18:32:51 -0000 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