Question on drivers/net/usb/kaweth.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oliver,

You're listed in the copyright for drivers/net/usb/kaweth.c, along with
several other people without email contact info.  The MAINTAINERS file
doesn't list this driver either.  Can you answer a question about this
driver, or direct it to someone who can?

I'm wondering why the driver doesn't use usb_reset_configuration() in
this function:

/****************************************************************
 *     kaweth_reset
 ****************************************************************/
static int kaweth_reset(struct kaweth_device *kaweth)
{
	int result;

	dbg("kaweth_reset(%p)", kaweth);
	result = kaweth_control(kaweth,
				usb_sndctrlpipe(kaweth->dev, 0),
				USB_REQ_SET_CONFIGURATION,
				0,
				kaweth->dev->config[0].desc.bConfigurationValue,
				0,
				NULL,
				0,
				KAWETH_CONTROL_TIMEOUT);

	mdelay(10);

	dbg("kaweth_reset() returns %d.",result);

	return result;
}

This shortcut bypasses a lot of checking by the USB core, and doesn't
allow the EHCI driver to clear the data toggle for the endpoints.  I
care for the xHCI driver because I'm adding a bandwidth lock to the USB
core, and this driver either needs to use usb_reset_configuration(), or
lock the bus bandwidth mutex, call usb_hcd_check_bandwidth(), send the
control message, call usb_hcd_reset_bandwidth() if that fails, and then
unlock the bus.

It would be much less duplicated code if kaweth_reset() just called
usb_reset_configuration().  kaweth_reset() is only called during probe,
if that matters.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux