]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/rndis.h
usb: gadget: sdp: add missing line breaks
[u-boot] / drivers / usb / gadget / rndis.h
index 73a1204a0310807f6072d38aac78089baf1556cf..084af8541ce0a458842f6b9875aa94ed4d56783f 100644 (file)
@@ -4,12 +4,10 @@
  * Authors:    Benedikt Spranger, Pengutronix
  *             Robert Schwebel, Pengutronix
  *
- *             This program is free software; you can redistribute it and/or
- *             modify it under the terms of the GNU General Public License
- *             version 2, as published by the Free Software Foundation.
- *
  *             This software was originally developed in conformance with
  *             Microsoft's Remote NDIS Specification License Agreement.
+ *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #ifndef _USBGADGET_RNDIS_H
 
 #include "ndis.h"
 
+/*
+ * By default rndis_signal_disconnect does not send status message about
+ * RNDIS disconnection to USB host (indicated as cable disconnected).
+ * Define RNDIS_COMPLETE_SIGNAL_DISCONNECT to send it.
+ * However, this will cause 1 sec delay on Ethernet device halt.
+ * Usually you do not need to define it. Mostly usable for debugging.
+ */
+
 #define RNDIS_MAXIMUM_FRAME_SIZE       1518
 #define RNDIS_MAX_TOTAL_SIZE           1558
 
@@ -216,23 +222,34 @@ typedef struct rndis_params {
 
        const u8                *host_mac;
        u16                     *filter;
-       struct eth_device       *dev;
        struct net_device_stats *stats;
        int                     mtu;
 
        u32                     vendorID;
        const char              *vendorDescr;
-       int                     (*ack)(struct eth_device *);
+#ifndef CONFIG_DM_ETH
+       struct eth_device       *dev;
+       int (*ack)(struct eth_device *);
+#else
+       struct udevice          *dev;
+       int (*ack)(struct udevice *);
+#endif
        struct list_head        resp_queue;
 } rndis_params;
 
 /* RNDIS Message parser and other useless functions */
 int  rndis_msg_parser(u8 configNr, u8 *buf);
 enum rndis_state rndis_get_state(int configNr);
-int  rndis_register(int (*rndis_control_ack)(struct eth_device *));
 void rndis_deregister(int configNr);
+#ifndef CONFIG_DM_ETH
+int  rndis_register(int (*rndis_control_ack)(struct eth_device *));
 int  rndis_set_param_dev(u8 configNr, struct eth_device *dev, int mtu,
-                       struct net_device_stats *stats, u16 *cdc_filter);
+                        struct net_device_stats *stats, u16 *cdc_filter);
+#else
+int  rndis_register(int (*rndis_control_ack)(struct udevice *));
+int  rndis_set_param_dev(u8 configNr, struct udevice *dev, int mtu,
+                        struct net_device_stats *stats, u16 *cdc_filter);
+#endif
 int  rndis_set_param_vendor(u8 configNr, u32 vendorID,
                            const char *vendorDescr);
 int  rndis_set_param_medium(u8 configNr, u32 medium, u32 speed);