Re: an driver with cisco aironet mini-pci 350

Doug Ambrisko <[email protected]>
Newsgroups gmane.os.freebsd.devel.mobile
Message-ID <[email protected]>
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 [email protected]
with "unsubscribe freebsd-mobile" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.