Subject: Re: ath0 on cardbus
To: Ed Gould <ed@left.wing.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: current-users
Date: 01/03/2007 12:48:57
I have been using ath on cardbus and mini-pci for a long time, and am
currently with

  4.99.5 NetBSD 4.99.5 (GENERIC.MPACPI) #7: Sun Dec  3 22:41:41 EST 2006

and it works fine, except for sometimes failing to allocate memory on
insert.  I find that running 'touchmem 256' (which produces 256 MB
free memory) before inserting solves the problem.  I have not seem
crashes.

  "no cardbus0 at cbb0"

This sounds like you may somehow have a kernel without proper cardbus
support.  On my notebook (Thinkpad T60), I get the following at boot time:

cbb0 at pci6 dev 0 function 0: Texas Instruments PCI1510 PCI-CardBus Bridge (rev. 0x00)
cbb0: interrupting at ioapic0 pin 16 (irq 11)
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 7
pcmcia0 at cardslot0

On inserting a card (ath1 because ath0 is builtin minipci):

ath1 at cardbus0 function 0
ath1: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath1: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath1: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath1: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath1: mac 5.6 phy 4.1 5 GHz radio 1.7 2 GHz radio 2.3


Is your kernel config odd, and in particular is it missing some of the
cardbus attachment lines?


---------------------------------------- touchmem.c ------------------------------

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main(int argc, char **argv)
{
	char *foo;
	int i, pgsize, size;

	if (argc != 2) {
		printf("usage: touchmem size (in MB)\n");
		exit(EXIT_FAILURE);
	}
	  
	size = atoi(argv[1]) * 1024 * 1024;

	
	pgsize = getpagesize();

	foo = malloc(size);
	if (foo == NULL) {
		printf("Can't malloc.\n");
		exit(EXIT_FAILURE);
	}

	for (i = 0; i < size; i += pgsize)
		foo[i] = 1;
	exit(EXIT_SUCCESS);
}