Date: Tue, 22 Aug 2000 17:43:14 +0100 (BST) From: Steve Roome <steve@sse0691.bri.hp.com> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/20783: patch to use IPACv1.2 with Message-ID: <200008221643.RAA62521@sse0691.bri.hp.com>
next in thread | raw e-mail | index | archive | help
>Number: 20783
>Category: kern
>Synopsis: patch to use IPACv1.2 with
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Aug 22 09:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Steve Roome
>Release: FreeBSD 4.1-STABLE i386
>Organization:
>Environment:
4.1-stable
This is a patch to the i4b source to work with IPAC v1.2
it's pulled from a mailing list and this is after it's been
applied successfully.
>Description:
newer PCI isdn cards might report themselves as IPAC v1.2
but the driver doesn't by default support this, although
it does seem work to treat it similarly to IPAC v.1.1
>How-To-Repeat:
An attempt to use a newer PCI ISDN card that reports itself
as being IPAC v.1.2 will cause the driver to malfunction.
>Fix:
diff -ur i4b.2/layer1/i4b_avm_fritz_pci.c i4b/layer1/i4b_avm_fritz_pci.c
--- i4b.2/layer1/i4b_avm_fritz_pci.c Thu Aug 3 00:52:55 2000
+++ i4b/layer1/i4b_avm_fritz_pci.c Mon Aug 21 19:05:12 2000
@@ -39,7 +39,7 @@
*
* $Id: i4b_avm_fritz_pci.c,v 1.3 1999/12/13 21:25:26 hm Exp $
*
- * $FreeBSD: src/sys/i4b/layer1/i4b_avm_fritz_pci.c,v 1.6.2.1 2000/08/02 23:52:55 peter Exp $
+ * $FreeBSD: src/sys/i4b/layer1/i4b_avm_fritz_pci.c,v 1.6 1999/12/14 20:48:18 hm Exp $
*
* last edit-date: [Mon Dec 13 21:59:04 1999]
*
@@ -504,7 +504,7 @@
asc->avma1pp_unit = unit;
- rid = PCIR_MAPS+4;
+ rid = PCI_MAP_REG_START+4;
asc->avma1pp_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
0, ~0, 1, RF_ACTIVE);
@@ -523,7 +523,7 @@
RF_SHAREABLE | RF_ACTIVE);
if (asc->avma1pp_irq == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, asc->avma1pp_res);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCI_MAP_REG_START+4, asc->avma1pp_res);
printf("avma1pp%d: couldn't map interrupt\n", unit);
error = ENXIO;
goto fail;
@@ -533,7 +533,7 @@
if (error) {
bus_release_resource(dev, SYS_RES_IRQ, 0, asc->avma1pp_res);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, asc->avma1pp_res);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCI_MAP_REG_START+4, asc->avma1pp_res);
printf("avma1pp%d: couldn't set up irq\n", unit);
goto fail;
}
diff -ur i4b.2/layer1/i4b_elsa_qs1p.c i4b/layer1/i4b_elsa_qs1p.c
--- i4b.2/layer1/i4b_elsa_qs1p.c Thu Aug 3 00:52:55 2000
+++ i4b/layer1/i4b_elsa_qs1p.c Mon Aug 21 19:05:12 2000
@@ -29,7 +29,7 @@
*
* $Id: i4b_elsa_qs1p.c,v 1.2 1999/12/13 21:25:26 hm Exp $
*
- * $FreeBSD: src/sys/i4b/layer1/i4b_elsa_qs1p.c,v 1.6.2.1 2000/08/02 23:52:55 peter Exp $
+ * $FreeBSD: src/sys/i4b/layer1/i4b_elsa_qs1p.c,v 1.6 1999/12/14 20:48:19 hm Exp $
*
* last edit-date: [Mon Dec 13 21:59:51 1999]
*
@@ -77,8 +77,8 @@
#define PORT0_MAPOFF 4
#define PORT1_MAPOFF 12
-#define ELSA_PORT0_MAPOFF (PCIR_MAPS+PORT0_MAPOFF)
-#define ELSA_PORT1_MAPOFF (PCIR_MAPS+PORT1_MAPOFF)
+#define ELSA_PORT0_MAPOFF (PCI_MAP_REG_START+PORT0_MAPOFF)
+#define ELSA_PORT1_MAPOFF (PCI_MAP_REG_START+PORT1_MAPOFF)
#define PCI_QS1000_DID 0x1000
#define PCI_QS1000_VID 0x1048
diff -ur i4b.2/layer1/i4b_ipac.h i4b/layer1/i4b_ipac.h
--- i4b.2/layer1/i4b_ipac.h Tue Dec 14 20:48:20 1999
+++ i4b/layer1/i4b_ipac.h Mon Aug 21 19:05:12 2000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -49,6 +49,7 @@
/* chip version */
#define IPAC_V11 0x01 /* IPAC Version 1.1 */
+#define IPAC_V12 0x02 /* IPAC Version 1.2 */
/*
* definitions of registers and bits for the IPAC ISDN chip.
diff -ur i4b.2/layer1/i4b_isic.c i4b/layer1/i4b_isic.c
--- i4b.2/layer1/i4b_isic.c Tue Dec 14 20:48:21 1999
+++ i4b/layer1/i4b_isic.c Mon Aug 21 19:05:12 2000
@@ -306,16 +306,17 @@
if(sc->sc_ipac)
{
- ret = IPAC_READ(IPAC_ID);
+ sc->sc_ipac_version = IPAC_READ(IPAC_ID);
- switch(ret)
+ switch(sc->sc_ipac_version)
{
- case 0x01:
+ case IPAC_V11:
+ case IPAC_V12:
break;
default:
printf("isic%d: Error, IPAC version %d unknown!\n",
- unit, ret);
+ unit, sc->sc_ipac_version);
return ENXIO;
break;
diff -ur i4b.2/layer1/i4b_l1.h i4b/layer1/i4b_l1.h
--- i4b.2/layer1/i4b_l1.h Tue Dec 14 20:48:22 1999
+++ i4b/layer1/i4b_l1.h Mon Aug 21 19:05:12 2000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -204,7 +204,8 @@
int sc_isac_version; /* version number of ISAC */
int sc_hscx_version; /* version number of HSCX */
-
+ int sc_ipac_version; /* version number of IPAC */
+
int sc_I430state; /* I.430 state F3 .... F8 */
int sc_I430T3; /* I.430 Timer T3 running */
diff -ur i4b.2/layer1/pci_isic.c i4b/layer1/pci_isic.c
--- i4b.2/layer1/pci_isic.c Sat Aug 28 01:45:44 1999
+++ i4b/layer1/pci_isic.c Mon Aug 21 19:05:13 2000
@@ -220,12 +220,15 @@
if(sc->sc_ipac)
{
- u_int ret = IPAC_READ(IPAC_ID);
+ sc->sc_ipac_version = IPAC_READ(IPAC_ID);
- switch(ret)
+ switch(sc->sc_ipac_version)
{
- case 0x01:
- printf("%s: IPAC PSB2115 Version 1.1\n", sc->sc_dev.dv_xname);
+ case IPAC_V11:
+ case IPAC_V12:
+ printf("%s: IPAC PSB2115 Version 1.%d\n",
+ sc->sc_dev.dv_xname,
+ sc->sc_ipac_versio);
break;
default:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008221643.RAA62521>
