Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104566
b: refs/heads/master
c: 15b2d2b
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 9a96dc9 commit 516882e
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 329 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7bb5ea54be47584869b9a748696e06788c55e28f
refs/heads/master: 15b2d2b529d11449910ac86f6093124bce8f6103
24 changes: 11 additions & 13 deletions trunk/drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,8 @@ static void eth_reset_config (struct eth_dev *dev)

netif_stop_queue (dev->net);
netif_carrier_off (dev->net);

/* RNDIS enters RNDIS_UNINITIALIZED state */
rndis_uninit(dev->rndis_config);

/* disable endpoints, forcing (synchronous) completion of
Expand Down Expand Up @@ -1604,8 +1606,6 @@ eth_disconnect (struct usb_gadget *gadget)
eth_reset_config (dev);
spin_unlock_irqrestore (&dev->lock, flags);

/* FIXME RNDIS should enter RNDIS_UNINITIALIZED */

/* next we may get setup() calls to enumerate new connections;
* or an unbind() during shutdown (including removing module).
*/
Expand Down Expand Up @@ -2067,23 +2067,23 @@ rndis_control_ack_complete (struct usb_ep *ep, struct usb_request *req)
eth_req_free(ep, req);
}

static int rndis_control_ack (struct net_device *net)
static void rndis_resp_avail(void *_dev)
{
struct eth_dev *dev = netdev_priv(net);
struct eth_dev *dev = _dev;
int length;
struct usb_request *resp = dev->stat_req;

/* in case RNDIS calls this after disconnect */
if (!dev->status) {
DEBUG (dev, "status ENODEV\n");
return -ENODEV;
return;
}

/* in case queue length > 1 */
if (resp->context) {
resp = eth_req_alloc (dev->status_ep, 8, GFP_ATOMIC);
if (!resp)
return -ENOMEM;
return;
}

/* Send RNDIS RESPONSE_AVAILABLE notification;
Expand All @@ -2101,13 +2101,11 @@ static int rndis_control_ack (struct net_device *net)
resp->status = 0;
rndis_control_ack_complete (dev->status_ep, resp);
}

return 0;
}

#else

#define rndis_control_ack NULL
#define rndis_resp_avail NULL

#endif /* RNDIS */

Expand Down Expand Up @@ -2566,18 +2564,18 @@ eth_bind (struct usb_gadget *gadget)

/* FIXME RNDIS vendor id == "vendor NIC code" == ? */

dev->rndis_config = rndis_register (rndis_control_ack);
if (dev->rndis_config < 0) {
status = rndis_register(rndis_resp_avail, dev);
if (status < 0) {
fail0:
unregister_netdev (dev->net);
status = -ENODEV;
goto fail;
}
dev->rndis_config = status;

/* these set up a lot of the OIDs that RNDIS needs */
rndis_set_host_mac (dev->rndis_config, dev->host_mac);
if (rndis_set_param_dev (dev->rndis_config, dev->net,
&dev->stats, &dev->cdc_filter))
&dev->cdc_filter))
goto fail0;
if (rndis_set_param_vendor(dev->rndis_config, vendorID,
manufacturer))
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/usb/gadget/ndis.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* ndis.h
*
* ndis.h
*
* ntddndis.h modified by Benedikt Spranger <b.spranger@pengutronix.de>
*
* Thanks to the cygwin development team,
*
* Thanks to the cygwin development team,
* espacially to Casper S. Hornstrup <chorns@users.sourceforge.net>
*
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
Expand Down
Loading

0 comments on commit 516882e

Please sign in to comment.