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

Commit a9877b83 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

net: usb: Implement new IOCTLs for RmNET data driver



RmNET data driver interacts with underlying RmNET HSIC
transport driver by issuing following new IOCTLs

RMNET_IOCTL_GET_SUPPORTED_FEATURES: Get the transport
driver supported features.
RMNET_IOCTL_SET_MRU: Set the MRU size.
RMNET_IOCTL_GET_MRU: Return the currently configured
MRU.
RMNET_IOCTL_GET_DRIVER_NAME: Get the underlying transport
peripheral driver name.

Change-Id: If52281e630d02be895beee8b43d122ea54e6d625
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 0cd8bf5b
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -572,6 +572,30 @@ static int rmnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
		DBG0("[%s] rmnet_ioctl(): close transport port\n", dev->name);
		break;

	case RMNET_IOCTL_GET_SUPPORTED_FEATURES:
		break;

	case RMNET_IOCTL_SET_MRU:
		if (test_bit(EVENT_DEV_OPEN, &unet->flags))
			return -EBUSY;

		/* 16K max */
		if ((size_t)ifr->ifr_ifru.ifru_data > 0x4000)
			return -EINVAL;

		unet->rx_urb_size = (size_t)ifr->ifr_ifru.ifru_data;
		DBG0("[%s] rmnet_ioctl(): SET MRU to %u\n", dev->name,
				unet->rx_urb_size);
		break;

	case RMNET_IOCTL_GET_MRU:
		ifr->ifr_ifru.ifru_data = (void *)unet->rx_urb_size;
		break;

	case RMNET_IOCTL_GET_DRIVER_NAME:
		rc = copy_to_user(ifr->ifr_ifru.ifru_data, unet->driver_name,
				strlen(unet->driver_name));
		break;
	default:
		dev_err(&unet->intf->dev, "[%s] error: "
			"rmnet_ioct called for unsupported cmd[%d]",