From patchwork Sun Jun 19 03:49:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 894262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5J3nvfO011703 for ; Sun, 19 Jun 2011 03:49:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751883Ab1FSDtz (ORCPT ); Sat, 18 Jun 2011 23:49:55 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:54831 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749Ab1FSDty (ORCPT ); Sat, 18 Jun 2011 23:49:54 -0400 X-Authority-Analysis: v=1.1 cv=5asQ6euaRPJxDdFxwvXsn6JDb7fmFbz8qWDLMfa45gU= c=1 sm=0 a=3rvgeqzMqd0A:10 a=Zvm7ikKeADQA:10 a=Zx2FLkwYMp0A:10 a=kj9zAlcOel0A:10 a=mpMdnlmFKti1S5SNY1DT+A==:17 a=yQdBAQUQAAAA:8 a=ppCmxOWCxf9IY5qlpcIA:9 a=HW6KEIzt3KygeQDocKUA:7 a=CjuIK1q_8ugA:10 a=IcxpeKGZWnEA:10 a=mpMdnlmFKti1S5SNY1DT+A==:117 X-Cloudmark-Score: 0 X-Originating-IP: 65.28.92.85 Received: from [65.28.92.85] ([65.28.92.85:37323] helo=larrylap.lan) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id DD/B3-24893-1E17DFD4; Sun, 19 Jun 2011 03:49:54 +0000 Date: Sat, 18 Jun 2011 22:49:53 -0500 From: Larry Finger To: John W Linville Cc: chaoming_li@realsil.com.cn, linux-wireless@vger.kernel.org Subject: [PATCH] rtlwifi: rtl8192se: Handle duplicate PCI ID 0x10ec:0x8192 conflict with r8192e_pci Message-ID: <4dfd71e1.ZoVUM+vtSzINuBtU%Larry.Finger@lwfinger.net> User-Agent: Heirloom mailx 12.2 01/07/07 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 19 Jun 2011 03:49:57 +0000 (UTC) There are two devices with PCI ID 0x10ec:0x8192, namely RTL8192E and RTL8192SE. The method of distinguishing them is by the revision ID at offset 0x8 of the PCI configuration space. If the value is 0x10, then the device uses rtl8192se for a driver. Signed-off-by: Larry Finger --- John, This patch is for kernel 3.0. Larry --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c =================================================================== --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/pci.c +++ wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c @@ -1615,6 +1615,16 @@ static bool _rtl_pci_find_adapter(struct pci_read_config_byte(pdev, 0x8, &revisionid); pci_read_config_word(pdev, 0x3C, &irqline); + /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses + * r8192e_pci, and RTL8192SE, which uses this driver. If the + * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then + * the correct driver is r8192e_pci, thus this routine should + * return false. + */ + if (deviceid == RTL_PCI_8192SE_DID && + revisionid == RTL_PCI_REVISION_ID_8192PCIE) + return false; + if (deviceid == RTL_PCI_8192_DID || deviceid == RTL_PCI_0044_DID || deviceid == RTL_PCI_0047_DID || @@ -1847,7 +1857,8 @@ int __devinit rtl_pci_probe(struct pci_d pci_write_config_byte(pdev, 0x04, 0x07); /* find adapter */ - _rtl_pci_find_adapter(pdev, hw); + if (!_rtl_pci_find_adapter(pdev, hw)) + goto fail3; /* Init IO handler */ _rtl_pci_io_handler_init(&pdev->dev, hw);