From owner-freebsd-questions@FreeBSD.ORG Sun Jan 13 17:00:16 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F9016A417 for ; Sun, 13 Jan 2008 17:00:16 +0000 (UTC) (envelope-from tkopets@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.189]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC2D13C45D for ; Sun, 13 Jan 2008 17:00:15 +0000 (UTC) (envelope-from tkopets@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so1845026rvb.43 for ; Sun, 13 Jan 2008 09:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=fZPPF1eKi4ubm52wCacO5XIA3NxAEAWGlnnXZe/kxdM=; b=FMHCpOnkx+NDoW3M4/u9swJ9eWoxP/picenBZPufuGu7YEUfFrnRi1dPJzwhvWYXL3Jmg3MfO+/NU1MzkRskk0gGdO2QH2Amla79Xzx1wydBcrq8Drh/o8Ucxg7tBFG8W1FnI9d3Vdo/asF+tbzZ0shrLm5e/WJA/ExZae42M6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Lvj3OGyYG6S5zYikz6s+r4JLdzLmexVSSgbukdfnVHIIcOUuV3tQNWZVVsphzEX1GbkKREhNFVfQB9wemmCxMb/8/1DR11E8YwJW1cljF/ksCKeDh9jowWf9u4CBpnMJmsP7F09l/LxM/PosN7LJgEuuXcjlcSk+JDe30yy8CSU= Received: by 10.141.79.12 with SMTP id g12mr3255516rvl.29.1200241992133; Sun, 13 Jan 2008 08:33:12 -0800 (PST) Received: by 10.140.251.21 with HTTP; Sun, 13 Jan 2008 08:33:12 -0800 (PST) Message-ID: Date: Sun, 13 Jan 2008 18:33:12 +0200 From: "Taras Kopets" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: pccard problem - old toshiba 440cdx X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2008 17:00:16 -0000 Hi list! I'm trying to make my PCMCIA ethernet card (3C589D-TP) to work, but with no luck. At boot time I get: CIS is too long -- truncating pccard1: Card has no functions! cbb1: PC Card card activation failed I've tried to google this problem on the web, but no solutions found, so I've decided to look at source of pccard. The origin of my problem comes from src/sys/dev/pccard/pccard_cis.c. I'm not expert in C, but the code I see in this file seems to be strange: --------------- CODE ------------- .................... #define PCCARD_CIS_SIZE 4096 .................... .................... int pccard_scan_cis(device_t bus, device_t dev, pccard_scan_t fct, void *arg) { .................... struct pccard_tuple tuple; .................... .................... tuple.memt = rman_get_bustag(res); tuple.memh = rman_get_bushandle(res); tuple.ptr = 0; DPRINTF(("cis mem map 0x%x (resource: 0x%lx)\n", (unsigned int) tuple.memh, rman_get_start(res))); tuple.mult = 2; .................... .................... if (tuple.mult * tuple.ptr >= PCCARD_CIS_SIZE - 1 - 32 /* ad hoc value */ ) { printf("CIS is too long -- truncating\n"); tuple.code = CISTPL_END; } else { /* get the tuple code */ tuple.code = pccard_cis_read_1(&tuple, tuple.ptr); } --------------- END OF CODE ------------- The strange thing is this: if (tuple.mult * tuple.ptr >= PCCARD_CIS_SIZE-1- 32) >From the code we have this values: tuple.mult=2 tuple.ptr=0 PCCARD_CIS_SIZE=4096 So we will always get to the "CIS is too long -- truncating" piece of code: if (0*2 >= 4096-1-32). Can this be the cause of problems? Please someone tell me I'm wrong. Thanks in advance, Sorry for my English, Taras Kopets