&dev_attr_vendorID,
NULL
};
+static int rndis_function_ctrlrequest(struct android_usb_function *f,
+ struct usb_composite_dev *cdev,
+ const struct usb_ctrlrequest *c)
+{
+ return rndis_setup(cdev, c);
+}
static struct android_usb_function rndis_function = {
.name = "rndis",
.cleanup = rndis_function_cleanup,
.bind_config = rndis_function_bind_config,
.unbind_config = rndis_function_unbind_config,
+ .ctrlrequest = rndis_function_ctrlrequest,
.attributes = rndis_function_attributes,
};
struct android_usb_function *f;
int value = -EOPNOTSUPP;
unsigned long flags;
-
req->zero = 0;
req->complete = composite_setup_complete;
req->length = 0;
case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
| HID_REQ_GET_REPORT):
VDBG(cdev, "get_report\n");
+ return -EOPNOTSUPP;
/* send an empty report */
length = min_t(unsigned, length, hidg->report_length);
memset(req->buf, 0x0, length);
-
goto respond;
break;
atomic_t notify_count;
};
+struct f_rndis *g_rndis;
+
static inline struct f_rndis *func_to_rndis(struct usb_function *f)
{
return container_of(f, struct f_rndis, port.func);
}
static int
-rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
+rndis_setup(struct usb_composite_dev *cdev, const struct usb_ctrlrequest *ctrl)
{
- struct f_rndis *rndis = func_to_rndis(f);
- struct usb_composite_dev *cdev = f->config->cdev;
+ //struct f_rndis *rndis = func_to_rndis(f);
+ //struct usb_composite_dev *cdev = f->config->cdev;
+ struct f_rndis *rndis = g_rndis;
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 w_length = le16_to_cpu(ctrl->wLength);
-
/* composite driver infrastructure handles everything except
* CDC class messages; interface activation uses set_alt().
*/
break;
default:
+
invalid:
VDBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length);
+ return -EOPNOTSUPP;
}
-
/* respond with data transfer or status phase? */
if (value >= 0) {
DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n",
rndis->port.func.bind = rndis_bind;
rndis->port.func.unbind = rndis_unbind;
rndis->port.func.set_alt = rndis_set_alt;
- rndis->port.func.setup = rndis_setup;
+ //rndis->port.func.setup = rndis_setup;
rndis->port.func.disable = rndis_disable;
-
+ g_rndis = rndis;
status = usb_add_function(c, &rndis->port.func);
if (status) {
kfree(rndis);