From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 12 20:43:41 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A7F516A41F for ; Sat, 12 Nov 2005 20:43:41 +0000 (GMT) (envelope-from dirkx@webweaving.org) Received: from skutsje.san.webweaving.org (skutsje.san.webweaving.org [209.132.96.45]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4046043D46 for ; Sat, 12 Nov 2005 20:43:39 +0000 (GMT) (envelope-from dirkx@webweaving.org) Received: from skutsje.san.webweaving.org (skutsje.san.webweaving.org [209.132.96.45] (may be forged)) by skutsje.san.webweaving.org (8.12.9/8.12.9) with ESMTP id jACKhS9H030246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Nov 2005 12:43:28 -0800 (PST) (envelope-from dirkx@webweaving.org) Received: from localhost (dirkx@localhost) by skutsje.san.webweaving.org (8.12.9/8.12.9/Submit) with ESMTP id jACKhRIA030243; Sat, 12 Nov 2005 12:43:28 -0800 (PST) (envelope-from dirkx@webweaving.org) X-Authentication-Warning: skutsje.san.webweaving.org: dirkx owned process doing -bs Date: Sat, 12 Nov 2005 12:43:27 -0800 (PST) From: Dirk-Willem van Gulik X-X-Sender: dirkx@skutsje.san.webweaving.org To: "M. Warner Losh" In-Reply-To: <20051112.104733.13599970.imp@bsdimp.com> Message-ID: <20051112122204.F29404@skutsje.san.webweaving.org> References: <20051112072658.Q14448@skutsje.san.webweaving.org> <20051112.104733.13599970.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-hackers@FreeBSD.org Subject: Re: Sierra Wireless / AC775 / Loading an external cisfile as a 'quirck' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2005 20:43:41 -0000 On Sat, 12 Nov 2005, M. Warner Losh wrote: > OpenBSD solved this problem by listing this card in > pcmica_cis_quirk.c. Maybe you can try that as an iterrum solution? Ack - thanks a lot for that pointer - trying that now. (Still gives me the error below; but I'll fiddle with it). > database of bad cards and automatically subsitute the right one? Do > we detach an reprobe the card when a new CIS is loaded in (like your > example above)? That would be very nice; or possibly with a pccardc power up/down (which we seem to have lost) or some similar 'reprobe' command. Having the kernel filled with all sort of quicks seems less ideal - such a live, after detect, method allows you to load a a CIS on detecting a certain card. > Being able to load CIS in would fix a bunch of multi-function cards > that aren't listed as such (and vice versa). And if the CIS would literally be a 'CIS' - then countless Linux and MacOSX 'drivers' start to work; as these often just consist of a CIS and a bind to something generic. Dw cbb0: [MPSAFE] cbb0: PCI Configuration space: 0x00: 0xac50104c 0x02100007 0x06070001 0x00022000 0x10: 0xf0222000 0x020000a0 0x20060504 0xfffff000 0x20: 0x00000000 0xfffff000 0x00000000 0xfffffffc 0x30: 0x00000000 0xfffffffc 0x00000000 0x07400112 0x40: 0x00000000 0x00000001 0x00000000 0x00000000 0x50: 0x00000000 0x00000000 0x00000000 0x00000000 0x60: 0x00000000 0x00000000 0x00000000 0x00000000 0x70: 0x00000000 0x00000000 0x00000000 0x00000000 0x80: 0x0044b060 0x00000000 0x00000000 0x00000022 0x90: 0x616600c0 0x00000000 0x00000000 0x00000000 0xa0: 0xfe110001 0x00c00000 0x00000015 0x0000001b 0xb0: 0x00000000 0x00000000 0x00000000 0x00000000 0xc0: 0x00000000 0x00000000 0x00000000 0x00000000 0xd0: 0x00000000 0x00000000 0x00000000 0x00000000 0xe0: 0x00000000 0x00000000 0x00000000 0x00000000 0xf0: 0x00000000 0x00000000 0x00000000 0x00000000 pci5: driver added cbb0: PC Card card activation failed pccard0: <16-bit PCCard bus> on cbb0 pccard0: chip_socket_enable pccard0: read_cis pcib4: pccard0 requested memory range 0xf0200000-0xf03fffff: good cis mem map 0xeb672000 (resource: 0xf0230000) pccard0: CIS tuple chain: CISTPL_DEVICE type=null speed=null 01 02 00 ff CISTPL_DEVICE_A type=eeprom speed=250ns 17 03 41 00 ff CISTPL_MANFID 20 04 92 01 10 07 CISTPL_FUNCID 21 02 06 00 CISTPL_VERS_1 15 31 07 00 53 69 65 72 72 61 20 57 69 72 65 6c 65 73 73 00 41 43 37 37 35 00 45 44 47 45 20 4e 65 74 77 6f 72 6b 20 41 64 61 70 74 65 72 00 52 31 00 ff CISTPL_CONFIG 1a 05 01 03 00 07 73 CISTPL_CFTABLE_ENTRY 1b 09 c1 41 19 01 55 66 30 f8 ff CISTPL_END ff cis mem map eb672000 CISTPL_LINKTARGET expected, code ff observed pccard0: check_cis_quirks pccard0: using CIS quirks for Sierra Wireless, AC775, EDGE Network Adapter, R1 pccard0: CIS version PC Card Standard 7.0 pccard0: CIS info: Sierra Wireless, AC775, EDGE Network Adapter, R1 pccard0: Manufacturer code 0x192, product 0x710 pccard0: function 1: serial port, ccr addr 700 mask 73 pccard0: function 1, config table entry 32: I/O card; irq mask 3fbc; iomask 0, iospace 3f8-3ff; io8 irqlevel pccard0: functions scanning pccard0: Card has 1 functions. pccard_mfc is 0 pccard0: I/O rid 0 start 3f8 end 3ff pcib4: pccard0 requested I/O range 0x3f8-0x3ff: in range pccard0: Allocation failed for cfe 32 pccard0: No config entry could be allocated. --- *************** *** 180,186 **** --- 180,228 ---- 0, /* maxtwins */ }; + static struct pccard_function pcmcia_sierra_a555_func1 = { + 1, /* function number */ + PCCARD_FUNCTION_SERIAL, + 0x24, /* last cfe number */ + 0x700, /* ccr_base */ + 0x73, /* ccr_mask */ + }; + + static struct pccard_config_entry pcmcia_sierra_a555_func1_cfe0 = { + 0x20, /* cfe number */ + PCCARD_CFE_IO8 | PCCARD_CFE_IRQLEVEL, PCCARD_IFTYPE_IO, + 1, /* num_iospace */ + 0, /* iomask */ + { { 0x0008, 0x3f8 } }, /* iospace */ + 0x3fbc, /* irqmask */ + 0, /* num_memspace */ + { }, /* memspace */ + 0, /* maxtwins */ + }; + /* Sierra */ + #define PCMCIA_VENDOR_SIERRA 0x0192 + #define PCMCIA_CIS_SIERRA_AC710 { NULL, NULL, NULL, NULL } + #define PCMCIA_PRODUCT_SIERRA_AC710 0x0710 + #define PCMCIA_CIS_SIERRA_A550 { NULL, NULL, NULL, NULL } + #define PCMCIA_PRODUCT_SIERRA_A550 0xa550 + #define PCMCIA_CIS_SIERRA_A555 { NULL, NULL, NULL, NULL } + #define PCMCIA_PRODUCT_SIERRA_A555 0xa555 + #define PCMCIA_CIS_SIERRA_A710 { NULL, NULL, NULL, NULL } + #define PCMCIA_PRODUCT_SIERRA_A710 0xa710 + static struct pccard_cis_quirk pccard_cis_quirks[] = { + { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A550, + PCMCIA_CIS_INVALID, + &pcmcia_sierra_a555_func1, &pcmcia_sierra_a555_func1_cfe0 }, + { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A555, + PCMCIA_CIS_INVALID, + &pcmcia_sierra_a555_func1, &pcmcia_sierra_a555_func1_cfe0 }, + { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_A710, + PCMCIA_CIS_INVALID, + &pcmcia_sierra_a555_func1, &pcmcia_sierra_a555_func1_cfe0 }, + { PCMCIA_VENDOR_SIERRA, PCMCIA_PRODUCT_SIERRA_AC710, + PCMCIA_CIS_INVALID, + &pcmcia_sierra_a555_func1, &pcmcia_sierra_a555_func1_cfe0 }, { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID, &pccard_3cxem556_func0, &pccard_3cxem556_func0_cfe0 }, { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID,