Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4415861pxa; Mon, 10 Aug 2020 08:34:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJhnZZ9uqAeIp5at59KFuSZVbxDJU+ZpHLlSaaBINihFl/WkoEynswFhnOoFLaf9NL/zNG X-Received: by 2002:a17:906:3e4f:: with SMTP id t15mr23392778eji.368.1597073668343; Mon, 10 Aug 2020 08:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597073668; cv=none; d=google.com; s=arc-20160816; b=ieG7SL4ZaH/xbDTiAHUnjg4aP9c0lBLpqPzE4eQIPXHK+RE9MWY/NnsgLjKG2nQoaa z6oO36l/+cRB19bLwwAUaq0MBmVhUnWSzmjQyiIM9d2PHWw8+8hvBHC4Z103RbIzCei2 M+yU85T16AVquYMY9N+dQD/nMLLFq8dQkn5wCt1LXN4r9D9fq8i6xuYxc6KN96GoDWWV 9XVVHc/e8H3S8nSapkfqFKVnT1ue1eTMZPhsoPyLusnXXHOgTRGTwUPly0sZJEAuZsg5 LTcWHYtVjJuVjGETLOeN9XUElwcMgtP6iV69nxwOK6cDgNzFlFPGVGXzEU7DUQuqLn4e 10qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YEHJWFTzFKMaB4JyiDTSRzJcYZzGPCoG3hf4dGxMpWI=; b=h+iPGPVnlPC5V03tF8fsuksfYUv+8RMECIeSN1J+0xRijSlXdFXLTvkgs8JOD5umwD LODJj73NIMOSLhKHapbW/JATt3WgVh1M2pxbiN0WgCf14pEWwqPEpIN2uCDalrci0imX BMwk8TdIShWo97AGz+iPH9ISWJQEs32YF+KahxEnKOJ5Km+BjO/SPkiBfXsPYgPVN+p8 gUhGDB/Q28e5Da9CoxCEdp2HGtK7AC9Z9ZAsxBDXYuJcXEIBvbWd46MQcxOwpqCiAs4x FaD6QIgfT006CS/KYgnKWuuTbyCzLKDdS4asl/WdMudV/thxcst+biZNdMLQAR/MqWVK bahg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UaXb6mE4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si10766960edq.250.2020.08.10.08.34.05; Mon, 10 Aug 2020 08:34:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UaXb6mE4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728782AbgHJPdh (ORCPT + 99 others); Mon, 10 Aug 2020 11:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:36326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729005AbgHJP3q (ORCPT ); Mon, 10 Aug 2020 11:29:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 35D1E22D02; Mon, 10 Aug 2020 15:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597073385; bh=0ic/MFHFC+9QS5ztGL8rzt9gzgW7YB2xoKPhU9kpm/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UaXb6mE4g0h8dRfqhME2XOtYW6ECKQ9T7u5Evx9AuqiL8TIX82a2gbiCHjTft8nBE aFHTgaLxtA5YNpfb+PKdc9nXd+UggH2u8dfFSIDECkDnLhxK4VvIyHb2kBLiJcYVcv l4t2H9TkvHouPgeDnu1//asf2Ct5ZxoPoeTQyEto= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Christoph Jung Subject: [PATCH 4.19 02/48] USB: iowarrior: fix up report size handling for some devices Date: Mon, 10 Aug 2020 17:21:24 +0200 Message-Id: <20200810151804.330529242@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810151804.199494191@linuxfoundation.org> References: <20200810151804.199494191@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman commit 17a82716587e9d7c3b246a789add490b2b5dcab6 upstream. In previous patches that added support for new iowarrior devices, the handling of the report size was not done correct. Fix that up and update the copyright date for the driver Reworked from an original patch written by Christoph Jung. Fixes: bab5417f5f01 ("USB: misc: iowarrior: add support for the 100 device") Fixes: 5f6f8da2d7b5 ("USB: misc: iowarrior: add support for the 28 and 28L devices") Fixes: 461d8deb26a7 ("USB: misc: iowarrior: add support for 2 OEMed devices") Cc: stable Reported-by: Christoph Jung Link: https://lore.kernel.org/r/20200726094939.1268978-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/iowarrior.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -2,8 +2,9 @@ /* * Native support for the I/O-Warrior USB devices * - * Copyright (c) 2003-2005 Code Mercenaries GmbH - * written by Christian Lucht + * Copyright (c) 2003-2005, 2020 Code Mercenaries GmbH + * written by Christian Lucht and + * Christoph Jung * * based on @@ -817,14 +818,28 @@ static int iowarrior_probe(struct usb_in /* we have to check the report_size often, so remember it in the endianness suitable for our machine */ dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint); - if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) && - ((dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) || - (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56AM) || - (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW28) || - (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW28L) || - (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW100))) - /* IOWarrior56 has wMaxPacketSize different from report size */ - dev->report_size = 7; + + /* + * Some devices need the report size to be different than the + * endpoint size. + */ + if (dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) { + switch (dev->product_id) { + case USB_DEVICE_ID_CODEMERCS_IOW56: + case USB_DEVICE_ID_CODEMERCS_IOW56AM: + dev->report_size = 7; + break; + + case USB_DEVICE_ID_CODEMERCS_IOW28: + case USB_DEVICE_ID_CODEMERCS_IOW28L: + dev->report_size = 4; + break; + + case USB_DEVICE_ID_CODEMERCS_IOW100: + dev->report_size = 13; + break; + } + } /* create the urb and buffer for reading */ dev->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);