Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Feb 2001 22:46:36 GMT
From:      gabriel@maquina.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/24854: NEWCARD support for Aironet driver an(4)
Message-ID:  <200102042246.f14MkaJ01308@minime.maquina.com>

next in thread | raw e-mail | index | archive | help

>Number:         24854
>Category:       kern
>Synopsis:       NEWCARD support for Aironet driver an(4)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 04 14:50:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jose Gabriel Marcelino
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Maquina de Estados Lda
>Environment:
System: FreeBSD minime.maquina.com 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Sun Feb 4 20:05:49 WET 2001 root@minime.maquina.com:/usr/src/sys/compile/MINIME i386
running under an Asus MP8300 Pentium III notebook.
Verbose boot messages available at: 
http://devils.maquina.com/~gabriel/boot.newcard

>Description:
The Aironet driver is somewhat broken under OLDCARD on recent -current 
(detaching the card causes a panic) but I feel it's better to have it 
correctly supported under NEWCARD right now, as most of the other wireless 
drivers have been already converted (wi(4) and ray(4)) 

>How-To-Repeat:
Use the Aironet card in any NEWCARD system

>Fix:
I'm submitting a patch, very similar to the one made to wi(4). I'm using it 
right now to send this PR so it works OK most of the time. I'm still getting
 panics after I reinsert the card (removal works fine), but I'm not sure if 
that's due to some NEWCARD brokeness.

Verbose card insert messages are available here:
http://devils.maquina.com/~gabriel/boot.an

The patch is at:
http://devils.maquina.com/~gabriel/patch.an
 
But I will also include it here for examination:


*** dev/an/if_an_pccard.c	Fri Oct 20 08:57:56 2000
--- /root/newcard/if_an_pccard.c	Sun Feb  4 22:32:35 2001
***************
*** 64,69 ****
--- 64,74 ----
  #include <net/if_dl.h>
  #include <net/if_types.h>
  
+ #include <dev/pccard/pccardvar.h>
+ #include <dev/pccard/pccarddevs.h>
+ 
+ #include "card_if.h"
+ 
  #ifndef lint
  static const char rcsid[] =
   "$FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.6 2000/10/20 07:57:56 jhb Exp $";
***************
*** 75,91 ****
  /*
   * Support for PCMCIA cards.
   */
  static int  an_pccard_probe(device_t);
  static int  an_pccard_attach(device_t);
  static int  an_pccard_detach(device_t);
  
  static device_method_t an_pccard_methods[] = {
  	/* Device interface */
! 	DEVMETHOD(device_probe,		an_pccard_probe),
! 	DEVMETHOD(device_attach,	an_pccard_attach),
  	DEVMETHOD(device_detach,	an_pccard_detach),
  	DEVMETHOD(device_shutdown,	an_shutdown),
  
  	{ 0, 0 }
  };
  
--- 80,101 ----
  /*
   * Support for PCMCIA cards.
   */
+ static int  an_pccard_match(device_t);
  static int  an_pccard_probe(device_t);
  static int  an_pccard_attach(device_t);
  static int  an_pccard_detach(device_t);
  
  static device_method_t an_pccard_methods[] = {
  	/* Device interface */
! 	DEVMETHOD(device_probe,		pccard_compat_probe),
! 	DEVMETHOD(device_attach,	pccard_compat_attach),
  	DEVMETHOD(device_detach,	an_pccard_detach),
  	DEVMETHOD(device_shutdown,	an_shutdown),
  
+ 	/* Card interface */
+ 	DEVMETHOD(card_compat_match, 	an_pccard_match),
+ 	DEVMETHOD(card_compat_probe,	an_pccard_probe),
+ 	DEVMETHOD(card_compat_attach,	an_pccard_attach),
  	{ 0, 0 }
  };
  
***************
*** 98,103 ****
--- 108,132 ----
  static devclass_t an_pccard_devclass;
  
  DRIVER_MODULE(if_an, pccard, an_pccard_driver, an_pccard_devclass, 0, 0);
+ 
+ static const struct pccard_product an_pccard_products[] = {
+ 		{ PCCARD_STR_AIRONET_PC4800,	PCCARD_VENDOR_AIRONET,
+ 		  PCCARD_PRODUCT_AIRONET_PC4800,	0, 
+ 		  PCCARD_CIS_AIRONET_PC4800 },
+ };
+ 
+ static int
+ an_pccard_match(device_t dev)
+ {
+ 	const struct pccard_product *pp;
+ 
+ 	if ((pp = pccard_product_lookup(dev, an_pccard_products,
+ 		sizeof(an_pccard_products[0]), NULL)) != NULL) {
+ 			device_set_desc(dev, pp->pp_name);
+ 			return 0;
+ 	}
+ 	return ENXIO;
+ }
  
  static int 
  an_pccard_detach(device_t dev)
*** conf/files	Sun Feb  4 19:23:34 2001
--- /root/newcard/files	Sun Feb  4 22:32:19 2001
***************
*** 236,242 ****
  dev/an/if_an.c		optional an
  dev/an/if_an_isa.c	optional an isa
  dev/an/if_an_pccard.c	optional an card
! #dev/an/if_an_pccard.c	optional an pccard
  dev/an/if_an_pci.c	optional an pci
  dev/ar/if_ar.c		optional ar
  dev/ar/if_ar_pci.c	optional ar pci
--- 236,242 ----
  dev/an/if_an.c		optional an
  dev/an/if_an_isa.c	optional an isa
  dev/an/if_an_pccard.c	optional an card
! dev/an/if_an_pccard.c	optional an pccard
  dev/an/if_an_pci.c	optional an pci
  dev/ar/if_ar.c		optional ar
  dev/ar/if_ar_pci.c	optional ar pci
*** modules/an/Makefile	Sat Jan  6 13:59:40 2001
--- /root/newcard/Makefile	Sun Feb  4 22:32:50 2001
***************
*** 4,10 ****
  
  KMOD=	if_an
  SRCS=	if_an.c if_an_pccard.c if_an_pci.c if_an_isa.c
! SRCS+=	opt_inet.h device_if.h bus_if.h pci_if.h isa_if.h
  
  opt_inet.h:
  	echo "#define INET 1" > opt_inet.h
--- 4,10 ----
  
  KMOD=	if_an
  SRCS=	if_an.c if_an_pccard.c if_an_pci.c if_an_isa.c
! SRCS+=	opt_inet.h device_if.h bus_if.h pci_if.h isa_if.h card_if.h
  
  opt_inet.h:
  	echo "#define INET 1" > opt_inet.h


>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?200102042246.f14MkaJ01308>