Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2002 19:39:29 -0700 (PDT)
From:      Doug Ambrisko <ambrisko@ambrisko.com>
To:        Hudson Lee <hudlee@vineyard.net>
Cc:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: an driver with cisco aironet mini-pci 350
Message-ID:  <200208060239.g762dTG33822@ambrisko.com>
In-Reply-To: <20020727164749.GA48515@harlem.foo.bar>

next in thread | previous in thread | raw e-mail | index | archive | help
Since the latest Linux from Cisco has code to drive this card it shouldn't
be to hard to add support assuming they added the PCI attachment in
a reasonable way.  It's now very difficult to get programing information
directly from Cisco :-(  I have a mini-PCI to PCI adapter so I can
plug it into a couple of test systems including a Soekris box.
 
I have an older PCI version here.  Hopefully we just have to update
the attachment and it should just work.  Can you dump the the PCI registers
0x10 & 0x14 via pciconf -l.  We can probably just skip over the indirection
of the PLX chip and go straight into attaching the Aironet driver to the
rid.  You can try this guess at a patch for kicks.

Index: if_an_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/an/if_an_pci.c,v
retrieving revision 1.2.2.6
diff -u -r1.2.2.6 if_an_pci.c
--- if_an_pci.c	26 Sep 2001 01:02:01 -0000	1.2.2.6
+++ if_an_pci.c	6 Aug 2002 02:38:48 -0000
@@ -100,6 +100,7 @@
 #define AIRONET_DEVICEID_4500	0x4500
 #define AIRONET_DEVICEID_4800	0x4800
 #define AIRONET_DEVICEID_4xxx	0x0001
+#define AIRONET_DEVICEID_MPI350	0xA504
 #define AN_PCI_PLX_LOIO		0x14	/* PLX chip iobase */
 #define AN_PCI_LOIO		0x18	/* Aironet iobase */
 
@@ -131,6 +132,12 @@
 		t++;
 	}
 
+	if (pci_get_vendor(dev) == AIRONET_VENDORID &&
+	    pci_get_device(dev) == AIRONET_DEVICEID_MPI350) {
+			device_set_desc(dev, "Cisco Aironet MPI350");
+			return(0);
+	}
+
 	return(ENXIO);
 }
 
@@ -150,21 +157,24 @@
 	flags = device_get_flags(dev);
 	bzero(sc, sizeof(struct an_softc));
 
-	/*
-	 * Map control/status registers.
- 	 */
-	command = pci_read_config(dev, PCIR_COMMAND, 4);
-	command |= PCIM_CMD_PORTEN;
-	pci_write_config(dev, PCIR_COMMAND, command, 4);
-	command = pci_read_config(dev, PCIR_COMMAND, 4);
-
-	if (!(command & PCIM_CMD_PORTEN)) {
-		printf("an%d: failed to enable I/O ports!\n", unit);
-		error = ENXIO;
-		goto fail;
+	if (pci_get_device(dev) == AIRONET_DEVICEID_MPI350) {
+		sc->port_rid = AN_PCI_PLX_LOIO;
+	} else {
+		/*
+		 * Map control/status registers.
+	 	 */
+		command = pci_read_config(dev, PCIR_COMMAND, 4);
+		command |= PCIM_CMD_PORTEN;
+		pci_write_config(dev, PCIR_COMMAND, command, 4);
+		command = pci_read_config(dev, PCIR_COMMAND, 4);
+
+		if (!(command & PCIM_CMD_PORTEN)) {
+			printf("an%d: failed to enable I/O ports!\n", unit);
+			error = ENXIO;
+			goto fail;
+		}
+		sc->port_rid = AN_PCI_LOIO;
 	}
-
-	sc->port_rid = AN_PCI_LOIO;
 	error = an_alloc_port(dev, sc->port_rid, 1);
 
 	if (error) {

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208060239.g762dTG33822>