@@ -400,6 +400,44 @@ static ssize_t raw_ip_store(struct device *d, struct device_attribute *attr, co
return ret;
}
+static ssize_t rx_urb_size_show(struct device *d, struct device_attribute *attr, char *buf)
+{
+ struct usbnet *dev = netdev_priv(to_net_dev(d));
+
+ return sprintf(buf, "%zd\n", dev->rx_urb_size);
+}
+
+static ssize_t rx_urb_size_store(struct device *d, struct device_attribute *attr,
+ const char *buf, size_t len)
+{
+ struct usbnet *dev = netdev_priv(to_net_dev(d));
+ u32 rx_urb_size;
+ int ret;
+
+ if (kstrtou32(buf, 0, &rx_urb_size))
+ return -EINVAL;
+
+ /* no change? */
+ if (rx_urb_size == dev->rx_urb_size)
+ return len;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ /* we don't want to modify a running netdev */
+ if (netif_running(dev->net)) {
+ netdev_err(dev->net, "Cannot change a running device\n");
+ ret = -EBUSY;
+ goto err;
+ }
+
+ dev->rx_urb_size = rx_urb_size;
+ ret = len;
+err:
+ rtnl_unlock();
+ return ret;
+}
+
static ssize_t add_mux_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct net_device *dev = to_net_dev(d);
@@ -505,6 +543,7 @@ static DEVICE_ATTR_RW(add_mux);
static DEVICE_ATTR_RW(del_mux);
static struct attribute *qmi_wwan_sysfs_attrs[] = {
+ &dev_attr_rx_urb_size.attr,
&dev_attr_raw_ip.attr,
&dev_attr_add_mux.attr,
&dev_attr_del_mux.attr,