From owner-freebsd-hackers Sat Mar 11 18:44:14 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id SAA03519 for hackers-outgoing; Sat, 11 Mar 1995 18:44:14 -0800 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id SAA03513 for ; Sat, 11 Mar 1995 18:44:10 -0800 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.8/8.6.6) id SAA04768; Sat, 11 Mar 1995 18:43:54 -0800 From: "Rodney W. Grimes" Message-Id: <199503120243.SAA04768@gndrsh.aac.dev.com> Subject: Re: configuring 2 Ultrastore U24F cards in 1 system To: wilko@yedi.iaf.nl (Wilko Bulte) Date: Sat, 11 Mar 1995 18:43:53 -0800 (PST) Cc: FreeBSD-hackers@FreeBSD.org In-Reply-To: <199503112138.WAA00159@yedi.iaf.nl> from "Wilko Bulte" at Mar 11, 95 10:38:52 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 2851 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Hi > > Has anybody ever tried to use 2 (or more) Ultrastore U24F EISA scsi cards > in one system? If so, how does the kernel config file look like? > > I have 2 of these boards, and it looks like the driver doesnot correctly > probe the cards. It finds the first card twice(..). ioconf.c as generated > by config looks OK to me > I just took a quick look at the ultra14f.c driver, the code in routine uha24_init(unit) is seriously broken with respect to more than one card. It will always return the lowest slot numbered 24F it finds, try this patch it should fix it. Index: ultra14f.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/ultra14f.c,v retrieving revision 1.27 diff -c -r1.27 ultra14f.c *** 1.27 1995/01/07 23:23:40 --- ultra14f.c 1995/03/12 02:43:20 *************** *** 274,279 **** --- 274,281 ---- struct mscp *cheat; unsigned long int scratch; + #define EISA_MAX_SLOTS 16 /* XXX This should go into a comon header */ + static uha_slot = 0; /* slot last board was found in */ static uha_unit = 0; #define UHA_SHOWMSCPS 0x01 #define UHA_SHOWINTS 0x02 *************** *** 923,940 **** { unsigned char p0, p1, p2, p3, p5, p7; unsigned char id[7], rev, haid; ! int slot, port, irq, i; int resetcount = 4000; struct uha_data *uha = uhadata[unit]; struct uha_reg *ur = uhareg[unit]; struct uha_bits *ub = uhabits[unit]; /* Search for the 24F's product ID */ ! for (slot = 1; slot < 15; slot++) { /* * Prepare to use a 24F. */ ! port = EISA_CONFIG | (slot << 12); ur->id = port + 0x00; ur->type = port + 0x02; ur->ectl = port + 0x04; --- 925,943 ---- { unsigned char p0, p1, p2, p3, p5, p7; unsigned char id[7], rev, haid; ! int port = 0, irq, i; int resetcount = 4000; struct uha_data *uha = uhadata[unit]; struct uha_reg *ur = uhareg[unit]; struct uha_bits *ub = uhabits[unit]; /* Search for the 24F's product ID */ ! while (uha_slot < EISA_MAX_SLOTS) { ! uha_slot++; /* * Prepare to use a 24F. */ ! port = EISA_CONFIG | (uha_slot << 12); ur->id = port + 0x00; ur->type = port + 0x02; ur->ectl = port + 0x04; *************** *** 984,990 **** /* We only want the 24F product ID. */ if (!strcmp(id, "USC024")) break; } ! if (slot == 15) return(ENODEV); /* We have the card! Grab remaining config. */ p5 = inb(ur->config); --- 987,993 ---- /* We only want the 24F product ID. */ if (!strcmp(id, "USC024")) break; } ! if (uha_slot == EISA_MAX_SLOTS) return(ENODEV); /* We have the card! Grab remaining config. */ p5 = inb(ur->config); -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Custom computers for FreeBSD