lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0708241449520.22079-100000@iolanthe.rowland.org>
Date:	Fri, 24 Aug 2007 14:55:53 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Greg KH <greg@...ah.com>
cc:	Oliver Neukum <oliver@...kum.org>, Matt Colyer <matt@...yer.name>,
	<linux-kernel@...r.kernel.org>, <jeffm@...e.de>,
	<linux-usb-devel@...ts.sourceforge.net>
Subject: Re: [linux-usb-devel] [RFC] USB: driver for iphone charging

On Fri, 24 Aug 2007, Greg KH wrote:

> Can someone with a iphone test this out?  If you look at how the
> berry_charge driver does it, the set_config stuff happens after the
> magic command.  As I don't have an iphone, nor have I ever seen any
> dumps of the command streams, I don't really know if the set_config
> message really is necessary or not.

You know, now that I think back on it, it may be that the Set-Config
really does have to come after the magic command.  Perhaps it triggers
the changeover.  In which case the subroutine should look like this:

static int iphone_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{
	struct usb_device *udev = interface_to_usbdev(intf);
	int rc;

	if (udev->actconfig->desc.bConfigurationValue != 3) {
		dbg(&udev->dev, "Sending magic comand\n");
		rc = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
				0x40, (USB_DIR_OUT | USB_TYPE_VENDOR |
					USB_RECIP_DEVICE),
				0x6400, 0, NULL, 0, 1000);
		if (rc)
			dev_err(&udev->dev, "Command failed: %d\n", rc);
		else {
			dbg(&udev->dev, "Calling set_configuration\n");
			rc = usb_driver_set_configuration(udev, 3);
			if (rc)
				dev_err(&udev->dev, "Set-Config failed: %d\n",
						rc);
		}
	}

	/* we don't really want to bind to the device, userspace programs can
	 * handle the syncing just fine, so get outta here. */
	return -ENODEV;
}

However Oliver's point is well taken.  This simple sort of manipulation
could easily be done by a user program, started up by udev.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ