From patchwork Wed Sep 8 20:52:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 64214 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A9640B6EF2 for ; Thu, 9 Sep 2010 06:52:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506Ab0IHUwZ (ORCPT ); Wed, 8 Sep 2010 16:52:25 -0400 Received: from mail1-out1.atlantis.sk ([80.94.52.55]:44385 "EHLO mail.atlantis.sk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754148Ab0IHUwY (ORCPT ); Wed, 8 Sep 2010 16:52:24 -0400 Received: (qmail 11293 invoked from network); 8 Sep 2010 20:52:24 -0000 Received: from unknown (HELO pentium) (rainbow@rainbow-software.org@85.216.180.141) by mail.atlantis.sk with AES256-SHA encrypted SMTP; 8 Sep 2010 20:52:24 -0000 From: Ondrej Zary To: David Miller Subject: [PATCH v3] cxacru: ignore cx82310_eth devices Date: Wed, 8 Sep 2010 22:52:12 +0200 User-Agent: KMail/1.9.10 Cc: greg@kroah.com, simon@fire.lp0.eu, dbrownell@users.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <201009051901.13851.linux@rainbow-software.org> <201009052212.37015.linux@rainbow-software.org> <20100908.131227.28827971.davem@davemloft.net> In-Reply-To: <20100908.131227.28827971.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201009082252.15865.linux@rainbow-software.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Ignore ADSL routers, which can have the same vendor and product IDs as ADSL modems but should be handled by the cx82310_eth driver. This intentionally ignores device IDs that aren't currently handled by cx82310_eth. There may be other device IDs that perhaps shouldn't be claimed by cxacru. Signed-off-by: Ondrej Zary Signed-off-by: Simon Arlott --- linux-2.6.36-rc3-orig/drivers/usb/atm/cxacru.c 2010-08-29 17:36:04.000000000 +0200 +++ linux-2.6.36-rc3/drivers/usb/atm/cxacru.c 2010-09-08 22:42:47.000000000 +0200 @@ -1324,8 +1324,23 @@ static struct usbatm_driver cxacru_drive .tx_padding = 11, }; -static int cxacru_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) +static int cxacru_usb_probe(struct usb_interface *intf, + const struct usb_device_id *id) { + struct usb_device *usb_dev = interface_to_usbdev(intf); + char buf[15]; + + /* avoid ADSL routers (cx82310_eth) + * abort if bDeviceClass is 0xff and iProduct is "USB NET CARD" */ + if (usb_dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC + && usb_string(usb_dev, usb_dev->descriptor.iProduct, + buf, sizeof(buf)) > 0) { + if (!strcmp(buf, "USB NET CARD")) { + dev_info(&intf->dev, "ignoring cx82310_eth device\n"); + return -ENODEV; + } + } + return usbatm_usb_probe(intf, id, &cxacru_driver); }