}
}
-static int eth_stop(struct eth_dev *dev)
+static int eth_stop(struct udevice *udev)
{
+ struct ether_priv *priv = dev_get_priv(udev);
+ struct eth_dev *dev = &priv->ethdev;
#ifdef RNDIS_COMPLETE_SIGNAL_DISCONNECT
unsigned long ts;
unsigned long timeout = CONFIG_SYS_HZ; /* 1 sec to stop RNDIS */
/* Wait until host receives OID_GEN_MEDIA_CONNECT_STATUS */
ts = get_timer(0);
while (get_timer(ts) < timeout)
- usb_gadget_handle_interrupts(0);
+ dm_usb_gadget_handle_interrupts(udev->parent);
#endif
rndis_uninit(dev->rndis_config);
pr_err("The remote end did not respond in time.");
goto fail;
}
- usb_gadget_handle_interrupts(0);
+ dm_usb_gadget_handle_interrupts(udev->parent);
}
packet_received = 0;
printf("timeout sending packets to usb ethernet\n");
return -1;
}
- usb_gadget_handle_interrupts(0);
+ dm_usb_gadget_handle_interrupts(udev->parent);
}
free(rndis_pkt);
* 2) 'pullup' callback in your UDC driver can be improved to perform
* this deinitialization.
*/
- eth_stop(dev);
+ eth_stop(udev);
usb_gadget_disconnect(dev->gadget);
/* Clear pending interrupt */
if (dev->network_started) {
- usb_gadget_handle_interrupts(0);
+ dm_usb_gadget_handle_interrupts(udev->parent);
dev->network_started = 0;
}
}
struct ether_priv *priv = dev_get_priv(dev);
struct eth_dev *ethdev = &priv->ethdev;
- usb_gadget_handle_interrupts(0);
+ dm_usb_gadget_handle_interrupts(dev->parent);
if (packet_received) {
if (ethdev->rx_req) {
return ret;
}
- return usb_gadget_initialize(0);
+ return 0;
}
static int usb_eth_probe(struct udevice *dev)
static int usb_eth_unbind(struct udevice *dev)
{
- usb_gadget_release(0);
+ udc_device_put(dev->parent);
return 0;
}