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

Commit 110e5e7b authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: f_serial: Cleanup dead code related to DUN



Commit e96fc1ee ("usb: gadget: f_serial: Add support for DUN")
introduced several members in gserial structure but they
are not really used since u_serial does not support TIOCMSET/TIOCMGET
tty ioctls. Drop the dead code so that our generic serial implementation
in f_serial compliant to GKI.

Change-Id: I53fcc77c737f9c0ce021713ec024d36a73c143b8
Signed-off-by: default avatarPavankumar Kondeti <quic_pkondeti@quicinc.com>
parent 9aac0330
Loading
Loading
Loading
Loading
+0 −67
Original line number Diff line number Diff line
@@ -322,9 +322,6 @@ gser_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
			__func__, w_value & ACM_CTRL_DTR ? 1 : 0,
			w_value & ACM_CTRL_RTS ? 1 : 0);

		if (gser->port.notify_modem)
			gser->port.notify_modem(&gser->port, 0, w_value);

		break;

	default:
@@ -503,56 +500,6 @@ static void gser_connect(struct gserial *port)
	gser_notify_serial_state(gser);
}

static unsigned int gser_get_dtr(struct gserial *port)
{
	struct f_gser *gser = port_to_gser(port);

	if (gser->port_handshake_bits & ACM_CTRL_DTR)
		return 1;
	else
		return 0;
}

static unsigned int gser_get_rts(struct gserial *port)
{
	struct f_gser *gser = port_to_gser(port);

	if (gser->port_handshake_bits & ACM_CTRL_RTS)
		return 1;
	else
		return 0;
}

static unsigned int gser_send_carrier_detect(struct gserial *port,
	unsigned int yes)
{
	u16	state;
	struct f_gser *gser = port_to_gser(port);

	state = gser->serial_state;
	state &= ~ACM_CTRL_DCD;
	if (yes)
		state |= ACM_CTRL_DCD;

	gser->serial_state = state;
	return gser_notify_serial_state(gser);
}

static unsigned int gser_send_ring_indicator(struct gserial *port,
	unsigned int yes)
{
	u16	state;
	struct f_gser *gser = port_to_gser(port);

	state = gser->serial_state;
	state &= ~ACM_CTRL_RI;
	if (yes)
		state |= ACM_CTRL_RI;

	gser->serial_state = state;
	return gser_notify_serial_state(gser);
}

static void gser_disconnect(struct gserial *port)
{
	struct f_gser *gser = port_to_gser(port);
@@ -575,15 +522,6 @@ static int gser_send_break(struct gserial *port, int duration)
	return gser_notify_serial_state(gser);
}

static int gser_send_modem_ctrl_bits(struct gserial *port, int ctrl_bits)
{
	struct f_gser *gser = port_to_gser(port);

	gser->serial_state = ctrl_bits;

	return gser_notify_serial_state(gser);
}

/*-------------------------------------------------------------------------*/

/* serial function driver setup/binding */
@@ -795,11 +733,6 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi)
	gser->port.func.free_func = gser_free;
	gser->port.func.setup = gser_setup;
	gser->port.connect = gser_connect;
	gser->port.get_dtr = gser_get_dtr;
	gser->port.get_rts = gser_get_rts;
	gser->port.send_carrier_detect = gser_send_carrier_detect;
	gser->port.send_ring_indicator = gser_send_ring_indicator;
	gser->port.send_modem_ctrl_bits = gser_send_modem_ctrl_bits;
	gser->port.disconnect = gser_disconnect;
	gser->port.send_break = gser_send_break;

+0 −12
Original line number Diff line number Diff line
@@ -42,23 +42,11 @@ struct gserial {

	/* REVISIT avoid this CDC-ACM support harder ... */
	struct usb_cdc_line_coding port_line_coding;	/* 9600-8-N-1 etc */
	u16				serial_state;

	/* control signal callbacks*/
	unsigned int (*get_dtr)(struct gserial *p);
	unsigned int (*get_rts)(struct gserial *p);

	/* notification callbacks */
	void (*connect)(struct gserial *p);
	void (*disconnect)(struct gserial *p);
	int (*send_break)(struct gserial *p, int duration);
	unsigned int (*send_carrier_detect)(struct gserial *p,
			unsigned int yes);
	unsigned int (*send_ring_indicator)(struct gserial *p,
			unsigned int yes);
	int (*send_modem_ctrl_bits)(struct gserial *p, int ctrl_bits);
	/* notification changes to modem */
	void (*notify_modem)(void *gser, u8 portno, int ctrl_bits);
};

/* utilities to allocate/free request and buffer */