Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754709AbcDFLoO (ORCPT ); Wed, 6 Apr 2016 07:44:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:59031 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbcDFLoM (ORCPT ); Wed, 6 Apr 2016 07:44:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="80087018" From: Robert Dobrowolski To: linux-usb@vger.kernel.org Cc: robert.dobrowolski@linux.intel.com, rafal.f.redzimski@intel.com, stable@vger.kernel.org, oliver@neukum.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] net: cdc_ncm: update datagram size after changing mtu Date: Wed, 6 Apr 2016 13:41:09 +0200 Message-Id: <1459942869-13587-1-git-send-email-robert.dobrowolski@linux.intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 31 From: Rafal Redzimski Current implementation updates the mtu size and notify cdc_ncm device using USB_CDC_SET_MAX_DATAGRAM_SIZE request about datagram size change instead of changing rx_urb_size. Whenever mtu is being changed, datagram size should also be updated. Cc: Signed-off-by: Rafal Redzimski Signed-off-by: Robert Dobrowolski --- drivers/net/usb/cdc_ncm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 2fb31ed..4a47656 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -746,6 +746,8 @@ int cdc_ncm_change_mtu(struct net_device *net, int new_mtu) if (new_mtu <= 0 || new_mtu > maxmtu) return -EINVAL; net->mtu = new_mtu; + cdc_ncm_set_dgram_size(dev, new_mtu); + return 0; } EXPORT_SYMBOL_GPL(cdc_ncm_change_mtu); -- 1.9.1