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

Commit a6bdea09 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: misc: mdm_data_bridge: Clean the driver



Remove support for Interrupt IN data endpoint. Remove appendix of
ZLP after each OUT URB. Add support for required PIDs.
While at it, clean/refactor other parts of the driver.

Change-Id: I307fe2f70b51655cae9b7a529838b94c59d2ec22
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 84985b47
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 *);