aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/mctp/mctp-serial.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
index 9ac0e187f36e..eaa6fb3224bc 100644
--- a/drivers/net/mctp/mctp-serial.c
+++ b/drivers/net/mctp/mctp-serial.c
@@ -410,7 +410,14 @@ static const struct net_device_ops mctp_serial_netdev_ops = {
static void mctp_serial_setup(struct net_device *ndev)
{
ndev->type = ARPHRD_MCTP;
+
+ /* we limit at the fixed MTU, which is also the MCTP-standard
+ * baseline MTU, so is also our minimum
+ */
ndev->mtu = MCTP_SERIAL_MTU;
+ ndev->max_mtu = MCTP_SERIAL_MTU;
+ ndev->min_mtu = MCTP_SERIAL_MTU;
+
ndev->hard_header_len = 0;
ndev->addr_len = 0;
ndev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
@@ -432,9 +439,6 @@ static int mctp_serial_open(struct tty_struct *tty)
if (!tty->ops->write)
return -EOPNOTSUPP;
- if (tty->disc_data)
- return -EEXIST;
-
idx = ida_alloc(&mctp_serial_ida, GFP_KERNEL);
if (idx < 0)
return idx;
@@ -479,6 +483,7 @@ static void mctp_serial_close(struct tty_struct *tty)
int idx = dev->idx;
unregister_netdev(dev->netdev);
+ cancel_work_sync(&dev->tx_work);
ida_free(&mctp_serial_ida, idx);
}