mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
Revert "USB: gadget: android: android USB gadget improvements:"
This reverts commit 0ab69f47e1.
This commit is contained in:
@@ -802,28 +802,22 @@ config USB_ANDROID
|
||||
enabled and disabled dynamically.
|
||||
|
||||
config USB_ANDROID_ACM
|
||||
boolean "Android gadget ACM serial function"
|
||||
boolean "Android gadget ACM function"
|
||||
depends on USB_ANDROID
|
||||
help
|
||||
Provides ACM serial function for android gadget driver.
|
||||
Provides adb function for adb gadget driver.
|
||||
|
||||
config USB_ANDROID_ADB
|
||||
boolean "Android gadget adb function"
|
||||
depends on USB_ANDROID
|
||||
help
|
||||
Provides adb function for android gadget driver.
|
||||
Provides adb function for adb gadget driver.
|
||||
|
||||
config USB_ANDROID_MASS_STORAGE
|
||||
boolean "Android gadget mass storage function"
|
||||
depends on USB_ANDROID && SWITCH
|
||||
help
|
||||
Provides USB mass storage function for android gadget driver.
|
||||
|
||||
config USB_ANDROID_RNDIS
|
||||
boolean "Android gadget RNDIS ethernet function"
|
||||
depends on USB_ANDROID
|
||||
help
|
||||
Provides RNDIS ethernet function for android gadget driver.
|
||||
Provides USB mass storage function for adb gadget driver.
|
||||
|
||||
config USB_CDC_COMPOSITE
|
||||
tristate "CDC Composite Device (Ethernet and ACM)"
|
||||
|
||||
@@ -55,5 +55,4 @@ obj-$(CONFIG_USB_ANDROID) += android.o
|
||||
obj-$(CONFIG_USB_ANDROID_ACM) += f_acm.o u_serial.o
|
||||
obj-$(CONFIG_USB_ANDROID_ADB) += f_adb.o
|
||||
obj-$(CONFIG_USB_ANDROID_MASS_STORAGE) += f_mass_storage.o
|
||||
obj-$(CONFIG_USB_ANDROID_RNDIS) += f_rndis.o u_ether.o
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ void android_register_function(struct android_usb_function *f)
|
||||
{
|
||||
struct android_dev *dev = _android_dev;
|
||||
|
||||
printk(KERN_INFO "android_register_function %s\n", f->name);
|
||||
printk(KERN_INFO "android_register_function\n");
|
||||
list_add_tail(&f->list, &_functions);
|
||||
_registered_function_count++;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/usb/android_composite.h>
|
||||
|
||||
#include "u_serial.h"
|
||||
#include "gadget_chips.h"
|
||||
#include "linux/usb/android_composite.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -385,10 +385,10 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
usb_ep_disable(acm->notify);
|
||||
} else {
|
||||
VDBG(cdev, "init acm ctrl interface %d\n", intf);
|
||||
acm->notify_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.notify,
|
||||
acm->fs.notify);
|
||||
}
|
||||
acm->notify_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.notify,
|
||||
acm->fs.notify);
|
||||
usb_ep_enable(acm->notify, acm->notify_desc);
|
||||
acm->notify->driver_data = acm;
|
||||
|
||||
@@ -398,11 +398,11 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
gserial_disconnect(&acm->port);
|
||||
} else {
|
||||
DBG(cdev, "activate acm ttyGS%d\n", acm->port_num);
|
||||
acm->port.in_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.in, acm->fs.in);
|
||||
acm->port.out_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.out, acm->fs.out);
|
||||
}
|
||||
acm->port.in_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.in, acm->fs.in);
|
||||
acm->port.out_desc = ep_choose(cdev->gadget,
|
||||
acm->hs.out, acm->fs.out);
|
||||
gserial_connect(&acm->port, acm->port_num);
|
||||
|
||||
} else
|
||||
@@ -763,8 +763,6 @@ int __init acm_bind_config(struct usb_configuration *c, u8 port_num)
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_ANDROID_ACM
|
||||
|
||||
int acm_function_bind_config(struct usb_configuration *c)
|
||||
{
|
||||
int ret = acm_bind_config(c, 0);
|
||||
@@ -780,10 +778,7 @@ static struct android_usb_function acm_function = {
|
||||
|
||||
static int __init init(void)
|
||||
{
|
||||
printk(KERN_INFO "f_acm init\n");
|
||||
android_register_function(&acm_function);
|
||||
return 0;
|
||||
}
|
||||
module_init(init);
|
||||
|
||||
#endif /* CONFIG_USB_ANDROID_ACM */
|
||||
|
||||
@@ -235,7 +235,6 @@ static int __init create_bulk_endpoints(struct adb_dev *dev,
|
||||
return -ENODEV;
|
||||
}
|
||||
DBG(cdev, "usb_ep_autoconfig for ep_in got %s\n", ep->name);
|
||||
ep->driver_data = dev; /* claim the endpoint */
|
||||
dev->ep_in = ep;
|
||||
|
||||
ep = usb_ep_autoconfig(cdev->gadget, out_desc);
|
||||
@@ -244,7 +243,6 @@ static int __init create_bulk_endpoints(struct adb_dev *dev,
|
||||
return -ENODEV;
|
||||
}
|
||||
DBG(cdev, "usb_ep_autoconfig for adb ep_out got %s\n", ep->name);
|
||||
ep->driver_data = dev; /* claim the endpoint */
|
||||
dev->ep_out = ep;
|
||||
|
||||
/* now allocate requests for our endpoints */
|
||||
|
||||
@@ -69,9 +69,10 @@
|
||||
#include <linux/wakelock.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <linux/usb.h>
|
||||
#include <linux/usb_usual.h>
|
||||
#include <linux/usb/ch9.h>
|
||||
#include <linux/usb/composite.h>
|
||||
#include <linux/usb/gadget.h>
|
||||
#include <linux/usb/android_composite.h>
|
||||
|
||||
#include "gadget_chips.h"
|
||||
@@ -2755,7 +2756,8 @@ fsg_function_bind(struct usb_configuration *c, struct usb_function *f)
|
||||
else
|
||||
curlun->dev.parent = &cdev->gadget->dev;
|
||||
dev_set_drvdata(&curlun->dev, fsg);
|
||||
dev_set_name(&curlun->dev,"lun%d", i);
|
||||
snprintf(curlun->dev.bus_id, BUS_ID_SIZE,
|
||||
"lun%d", i);
|
||||
|
||||
rc = device_register(&curlun->dev);
|
||||
if (rc != 0) {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/usb/android_composite.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
|
||||
@@ -468,10 +467,10 @@ static int rndis_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
usb_ep_disable(rndis->notify);
|
||||
} else {
|
||||
VDBG(cdev, "init rndis ctrl %d\n", intf);
|
||||
rndis->notify_desc = ep_choose(cdev->gadget,
|
||||
rndis->hs.notify,
|
||||
rndis->fs.notify);
|
||||
}
|
||||
rndis->notify_desc = ep_choose(cdev->gadget,
|
||||
rndis->hs.notify,
|
||||
rndis->fs.notify);
|
||||
usb_ep_enable(rndis->notify, rndis->notify_desc);
|
||||
rndis->notify->driver_data = rndis;
|
||||
|
||||
@@ -485,11 +484,11 @@ static int rndis_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
|
||||
if (!rndis->port.in) {
|
||||
DBG(cdev, "init rndis\n");
|
||||
rndis->port.in = ep_choose(cdev->gadget,
|
||||
rndis->hs.in, rndis->fs.in);
|
||||
rndis->port.out = ep_choose(cdev->gadget,
|
||||
rndis->hs.out, rndis->fs.out);
|
||||
}
|
||||
rndis->port.in = ep_choose(cdev->gadget,
|
||||
rndis->hs.in, rndis->fs.in);
|
||||
rndis->port.out = ep_choose(cdev->gadget,
|
||||
rndis->hs.out, rndis->fs.out);
|
||||
|
||||
/* Avoid ZLPs; they can be troublesome. */
|
||||
rndis->port.is_zlp_ok = false;
|
||||
@@ -834,33 +833,3 @@ fail:
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_ANDROID_RNDIS
|
||||
#include "rndis.c"
|
||||
|
||||
// FIXME - using bogus MAC address for now
|
||||
|
||||
static u8 ethaddr[ETH_ALEN] = { 11, 22, 33, 44, 55, 66 };
|
||||
|
||||
int rndis_function_bind_config(struct usb_configuration *c)
|
||||
{
|
||||
int ret = gether_setup(c->cdev->gadget, ethaddr);
|
||||
if (ret == 0)
|
||||
ret = rndis_bind_config(c, ethaddr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct android_usb_function rndis_function = {
|
||||
.name = "rndis",
|
||||
.bind_config = rndis_function_bind_config,
|
||||
};
|
||||
|
||||
static int __init init(void)
|
||||
{
|
||||
printk(KERN_INFO "f_rndis init\n");
|
||||
android_register_function(&rndis_function);
|
||||
return 0;
|
||||
}
|
||||
module_init(init);
|
||||
|
||||
#endif /* CONFIG_USB_ANDROID_RNDIS */
|
||||
|
||||
@@ -112,7 +112,7 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
|
||||
int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
|
||||
int eem_bind_config(struct usb_configuration *c);
|
||||
|
||||
#if defined(CONFIG_USB_ETH_RNDIS) || defined(CONFIG_USB_ANDROID_RNDIS)
|
||||
#ifdef CONFIG_USB_ETH_RNDIS
|
||||
|
||||
int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user