Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36c62128 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: misc: mdm_data_bridge: Clean the driver"

parents 932d1cfc a6bdea09
Loading
Loading
Loading
Loading
+213 −427

File changed.

Preview size limit exceeded, changes collapsed.

+21 −3
Original line number Diff line number Diff line
@@ -17,12 +17,30 @@
#include <linux/netdevice.h>
#include <linux/usb.h>

#define MAX_BRIDGE_DEVICES 4
#define BRIDGE_NAME_MAX_LEN 20
#define MAX_INST_NAME_LEN 40

enum bridge_id {
	USB_BRIDGE_QDSS,
	USB_BRIDGE_DPL,
	MAX_BRIDGE_DEVICES,
};

static int bridge_name_to_id(const char *name)
{
	if (!name)
		goto fail;

	if (!strncasecmp(name, "qdss", MAX_INST_NAME_LEN))
		return USB_BRIDGE_QDSS;
	if (!strncasecmp(name, "dpl", MAX_INST_NAME_LEN))
		return USB_BRIDGE_DPL;

fail:
	return -EINVAL;
}

struct bridge_ops {
	int (*send_pkt)(void *, void *, size_t actual);
	void (*send_cbits)(void *, unsigned int);

	/* flow control */
	void (*unthrottle_tx)(void *);