From owner-p4-projects@FreeBSD.ORG Wed Mar 30 20:29:07 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71DCC16A4D0; Wed, 30 Mar 2005 20:29:03 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B84116A4CF for ; Wed, 30 Mar 2005 20:29:03 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66A6543D54 for ; Wed, 30 Mar 2005 20:29:02 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2UKT2pf060233 for ; Wed, 30 Mar 2005 20:29:02 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2UKT1K7060210 for perforce@freebsd.org; Wed, 30 Mar 2005 20:29:01 GMT (envelope-from sam@freebsd.org) Date: Wed, 30 Mar 2005 20:29:01 GMT Message-Id: <200503302029.j2UKT1K7060210@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 74119 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 20:29:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=74119 Change 74119 by sam@sam_ebb on 2005/03/30 20:28:19 IFC @ 74118 Affected files ... .. //depot/projects/wifi/etc/periodic/weekly/330.catman#2 integrate .. //depot/projects/wifi/lib/libdisk/change.c#2 integrate .. //depot/projects/wifi/libexec/rtld-elf/rtld.c#6 integrate .. //depot/projects/wifi/sbin/atacontrol/atacontrol.c#2 integrate .. //depot/projects/wifi/sbin/sunlabel/sunlabel.8#2 integrate .. //depot/projects/wifi/sbin/sunlabel/sunlabel.c#3 integrate .. //depot/projects/wifi/sys/compat/ndis/subr_ntoskrnl.c#11 integrate .. //depot/projects/wifi/sys/conf/files#21 integrate .. //depot/projects/wifi/sys/conf/kmod.mk#10 integrate .. //depot/projects/wifi/sys/conf/options#13 integrate .. //depot/projects/wifi/sys/dev/acpi_support/acpi_asus.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-all.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-all.h#3 integrate .. //depot/projects/wifi/sys/dev/ata/ata-card.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-cbus.c#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata-chipset.c#5 integrate .. //depot/projects/wifi/sys/dev/ata/ata-commands.h#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata-disk.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-disk.h#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata-dma.c#3 integrate .. //depot/projects/wifi/sys/dev/ata/ata-isa.c#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata-lowlevel.c#6 integrate .. //depot/projects/wifi/sys/dev/ata/ata-pci.c#3 integrate .. //depot/projects/wifi/sys/dev/ata/ata-pci.h#3 integrate .. //depot/projects/wifi/sys/dev/ata/ata-queue.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-raid.c#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata-raid.h#2 integrate .. //depot/projects/wifi/sys/dev/ata/ata_if.m#1 branch .. //depot/projects/wifi/sys/dev/ata/atapi-cd.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-cd.h#2 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-fd.c#2 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-fd.h#2 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-tape.c#3 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-tape.h#2 integrate .. //depot/projects/wifi/sys/dev/ath/ath_rate/amrr/amrr.c#10 integrate .. //depot/projects/wifi/sys/dev/ath/ath_rate/onoe/onoe.c#10 integrate .. //depot/projects/wifi/sys/dev/ath/if_ath.c#79 integrate .. //depot/projects/wifi/sys/dev/ath/if_athioctl.h#8 integrate .. //depot/projects/wifi/sys/dev/ath/if_athrate.h#5 integrate .. //depot/projects/wifi/sys/dev/ath/if_athvar.h#31 integrate .. //depot/projects/wifi/sys/dev/usb/ukbd.c#4 integrate .. //depot/projects/wifi/sys/geom/geom_pc98.c#4 integrate .. //depot/projects/wifi/sys/geom/geom_sunlabel_enc.c#3 integrate .. //depot/projects/wifi/sys/modules/Makefile#16 integrate .. //depot/projects/wifi/sys/modules/ata/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/Makefile.inc#1 branch .. //depot/projects/wifi/sys/modules/ata/ata/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atacam/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atacard/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atacbus/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atadisk/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/ataisa/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atapci/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atapicd/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atapifd/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/atapist/Makefile#1 branch .. //depot/projects/wifi/sys/modules/ata/ataraid/Makefile#1 branch .. //depot/projects/wifi/sys/netinet/ip_carp.c#4 integrate .. //depot/projects/wifi/sys/pc98/conf/GENERIC#6 integrate .. //depot/projects/wifi/sys/sys/ata.h#2 integrate .. //depot/projects/wifi/sys/sys/sun_disklabel.h#3 integrate .. //depot/projects/wifi/sys/vm/vm_object.c#10 integrate .. //depot/projects/wifi/tools/tools/ath/80211watch.c#3 integrate .. //depot/projects/wifi/usr.bin/make/cond.c#9 integrate .. //depot/projects/wifi/usr.bin/make/cond.h#2 integrate .. //depot/projects/wifi/usr.bin/make/globals.h#3 integrate .. //depot/projects/wifi/usr.bin/make/parse.c#12 integrate .. //depot/projects/wifi/usr.bin/make/parse.h#2 integrate .. //depot/projects/wifi/usr.bin/make/var.c#12 integrate .. //depot/projects/wifi/usr.sbin/sysinstall/disks.c#2 integrate Differences ... ==== //depot/projects/wifi/etc/periodic/weekly/330.catman#2 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh - # -# $FreeBSD: src/etc/periodic/weekly/330.catman,v 1.9 2002/03/05 19:13:05 cjc Exp $ +# $FreeBSD: src/etc/periodic/weekly/330.catman,v 1.10 2005/03/30 18:02:49 ru Exp $ # # If there is a global system configuration file, suck it in. @@ -34,7 +34,7 @@ rc=0 # Preformat original, non-localized manpages - echo /usr/libexec/catman.local "$MANPATH" | + echo /usr/libexec/catman.local -r "$MANPATH" | su -fm man || rc=3 # Preformat localized manpages. @@ -42,7 +42,7 @@ then for i in $man_locales do - echo /usr/libexec/catman.local -L \ + echo /usr/libexec/catman.local -Lr \ "$MANPATH" | LC_ALL=$i su -fm man || rc=3 done fi ==== //depot/projects/wifi/lib/libdisk/change.c#2 (text+ko) ==== @@ -8,7 +8,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdisk/change.c,v 1.25 2004/01/27 15:25:33 nyan Exp $"); +__FBSDID("$FreeBSD: src/lib/libdisk/change.c,v 1.26 2005/03/30 13:03:33 nyan Exp $"); #include #include @@ -40,7 +40,11 @@ if (disk->bios_cyl > 1024) #endif sane = 0; +#ifdef PC98 + if (disk->bios_hd >= 256) +#else if (disk->bios_hd > 16) +#endif sane = 0; #ifdef PC98 if (disk->bios_sect >= 256) @@ -68,8 +72,8 @@ return; /* Hmm, try harder... */ + /* Assume standard SCSI parameter */ #ifdef PC98 - /* Assume standard SCSI parameter */ disk->bios_sect = 128; disk->bios_hd = 8; #else @@ -77,6 +81,25 @@ #endif disk->bios_cyl = disk->chunks->size / (disk->bios_sect * disk->bios_hd); + +#ifdef PC98 + if (disk->bios_cyl < 65536) + return; + + /* Assume UIDE-133/98-A Challenger BIOS 0.9821C parameter */ + disk->bios_sect = 255; + disk->bios_hd = 16; + disk->bios_cyl = disk->chunks->size / + (disk->bios_sect * disk->bios_hd); + + if (disk->bios_cyl < 65536) + return; + + /* BIG-na-Drive? */ + disk->bios_hd = 255; + disk->bios_cyl = disk->chunks->size / + (disk->bios_sect * disk->bios_hd); +#endif } void ==== //depot/projects/wifi/libexec/rtld-elf/rtld.c#6 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.105 2005/03/24 10:12:29 cperciva Exp $ + * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.106 2005/03/30 08:28:26 dfr Exp $ */ /* @@ -2560,7 +2560,7 @@ size = tls_static_space; tls = malloc(size); - dtv = malloc((tls_max_index + 2) * sizeof(Elf_Addr)); + dtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); *(Elf_Addr**) tls = dtv; @@ -2601,8 +2601,6 @@ memcpy((void*) addr, obj->tlsinit, obj->tlsinitsize); dtv[obj->tlsindex + 1] = addr; - } else if (obj->tlsindex) { - dtv[obj->tlsindex + 1] = 0; } } } @@ -2629,7 +2627,7 @@ tlsstart = (Elf_Addr) tls; tlsend = tlsstart + size; for (i = 0; i < dtvsize; i++) { - if (dtv[i+2] < tlsstart || dtv[i+2] > tlsend) { + if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] > tlsend)) { free((void*) dtv[i+2]); } } @@ -2659,7 +2657,7 @@ assert(tcbsize >= 2*sizeof(Elf_Addr)); tls = malloc(size + tcbsize); - dtv = malloc((tls_max_index + 2) * sizeof(Elf_Addr)); + dtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); segbase = (Elf_Addr)(tls + size); ((Elf_Addr*)segbase)[0] = segbase; @@ -2703,8 +2701,6 @@ if (obj->tlsinit) memcpy((void*) addr, obj->tlsinit, obj->tlsinitsize); dtv[obj->tlsindex + 1] = addr; - } else if (obj->tlsindex) { - dtv[obj->tlsindex + 1] = 0; } } } @@ -2731,7 +2727,7 @@ tlsend = (Elf_Addr) tls; tlsstart = tlsend - size; for (i = 0; i < dtvsize; i++) { - if (dtv[i+2] < tlsstart || dtv[i+2] > tlsend) { + if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] > tlsend)) { free((void*) dtv[i+2]); } } ==== //depot/projects/wifi/sbin/atacontrol/atacontrol.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 - 2004 Søren Schmidt + * Copyright (c) 2000 - 2005 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sbin/atacontrol/atacontrol.c,v 1.32 2004/09/15 11:22:05 sos Exp $ + * $FreeBSD: src/sbin/atacontrol/atacontrol.c,v 1.33 2005/03/30 12:03:40 sos Exp $ */ #include @@ -373,17 +373,21 @@ iocmd.cmd = ATARAIDCREATE; if (argc > 2) { - if (!strcmp(argv[2], "RAID0") || - !strcmp(argv[2], "stripe")) - iocmd.u.raid_setup.type = 1; - if (!strcmp(argv[2], "RAID1") || - !strcmp(argv[2],"mirror")) - iocmd.u.raid_setup.type = 2; - if (!strcmp(argv[2], "RAID0+1")) - iocmd.u.raid_setup.type = 3; - if (!strcmp(argv[2], "SPAN") || - !strcmp(argv[2], "JBOD")) - iocmd.u.raid_setup.type = 4; + if (!strcasecmp(argv[2], "RAID0") || + !strcasecmp(argv[2], "stripe")) + iocmd.u.raid_setup.type = AR_RAID0; + if (!strcasecmp(argv[2], "RAID1") || + !strcasecmp(argv[2],"mirror")) + iocmd.u.raid_setup.type = AR_RAID1; + if (!strcasecmp(argv[2], "RAID0+1") || + !strcasecmp(argv[2],"RAID10")) + iocmd.u.raid_setup.type = AR_RAID01; + if (!strcasecmp(argv[2], "RAID5")) + iocmd.u.raid_setup.type = AR_RAID5; + if (!strcasecmp(argv[2], "SPAN")) + iocmd.u.raid_setup.type = AR_SPAN; + if (!strcasecmp(argv[2], "JBOD")) + iocmd.u.raid_setup.type = AR_JBOD; } if (!iocmd.u.raid_setup.type) { fprintf(stderr, "atacontrol: Invalid RAID type\n"); @@ -393,7 +397,9 @@ exit(EX_USAGE); } - if (iocmd.u.raid_setup.type & 1) { + if (iocmd.u.raid_setup.type == AR_RAID0 || + iocmd.u.raid_setup.type == AR_RAID01 || + iocmd.u.raid_setup.type == AR_RAID5) { if (argc < 4 || !sscanf(argv[3], "%d", &iocmd.u.raid_setup.interleave) == 1) { @@ -451,6 +457,14 @@ iocmd.cmd = ATARAIDREBUILD; if (ioctl(fd, IOCATA, &iocmd) < 0) warn("ioctl(ATARAIDREBUILD)"); + else { + char buffer[128]; + sprintf(buffer, "/usr/bin/nice -n 20 /bin/dd " + "if=/dev/ar%d of=/dev/null bs=1m &", + iocmd.channel); + if (system(buffer)) + warn("background dd"); + } } else if (!strcmp(argv[1], "status") && argc == 3) { int i; @@ -467,10 +481,16 @@ case AR_RAID1: printf("RAID1"); break; - case AR_RAID0 | AR_RAID1: + case AR_RAID01: printf("RAID0+1 stripesize=%d", iocmd.u.raid_status.interleave); break; + case AR_RAID5: + printf("RAID5 stripesize=%d", + iocmd.u.raid_status.interleave); + break; + case AR_JBOD: + printf("JBOD"); case AR_SPAN: printf("SPAN"); break; ==== //depot/projects/wifi/sbin/sunlabel/sunlabel.8#2 (text+ko) ==== @@ -1,6 +1,6 @@ .\" Copyright (c) 2004 .\" David E. O'Brien. All rights reserved. -.\" Copyright (c) 2004 +.\" Copyright (c) 2004, 2005 .\" Joerg Wunsch. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,9 +24,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sbin/sunlabel/sunlabel.8,v 1.4 2004/06/02 20:21:28 joerg Exp $ +.\" $FreeBSD: src/sbin/sunlabel/sunlabel.8,v 1.6 2005/03/30 18:54:41 joerg Exp $ .\" -.Dd June 1, 2004 +.Dd March 30, 2005 .Dt SUNLABEL 8 .Os .Sh NAME @@ -238,7 +238,7 @@ The label presented for editing is the same as the standard printout, with some added hints about the possible options to specify the sector size and starting cylinder. -There are two areas in the template that can be edited: +The following areas in the template can be edited: .Bl -tag -width indent .It Sy Textual label, geometry emulation The line @@ -266,6 +266,15 @@ .D1 Em (CC + 2) * HH * SS must be less than or equal to the total number of sectors of the disk (which is given as a hint in a comment field). +.It Sy Volume name +The volume name (if present) is introduced by the string +.Dq "volume name:" . +It can be up to 8 characters long, and might be useful to distinguish +different disks in a system. +Note that volume names require the VTOC elements to be present, so +any of the VTOC constraints described below need to be obeyed as well +if a volume name is to be set. +Setting an empty volume name will delete it from the label. .It Sy Partition entries Partition entries start with a letter from .Ql a ==== //depot/projects/wifi/sbin/sunlabel/sunlabel.c#3 (text+ko) ==== @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2004 Joerg Wunsch. + * Copyright (c) 2004,2005 Joerg Wunsch. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ */ #include -__FBSDID("$FreeBSD: src/sbin/sunlabel/sunlabel.c,v 1.12 2005/02/15 22:31:05 obrien Exp $"); +__FBSDID("$FreeBSD: src/sbin/sunlabel/sunlabel.c,v 1.13 2005/03/30 09:33:09 joerg Exp $"); #include #include @@ -541,6 +541,7 @@ char tag[32]; char buf[128]; char text[128]; + char volname[SUN_VOLNAME_LEN + 1]; struct sun_disklabel sl1; char *bp; const char *what; @@ -631,6 +632,33 @@ text, cyl, alt, hd, sec); continue; } + if (strncmp(bp, "volume name:", strlen("volume name:")) == 0) { + wantvtoc = 1; /* Volume name requires VTOC. */ + bp += strlen("volume name:"); +#if SUN_VOLNAME_LEN != 8 +# error "scanf field width does not match SUN_VOLNAME_LEN" +#endif + /* + * We set the field length to one more than + * SUN_VOLNAME_LEN to allow detecting an + * overflow. + */ + memset(volname, 0, sizeof volname); + rv = sscanf(bp, " %9[^\n]", volname); + if (rv != 1) { + /* Clear the volume name. */ + memset(sl1.sl_vtoc_volname, 0, + SUN_VOLNAME_LEN); + } else { + memcpy(sl1.sl_vtoc_volname, volname, + SUN_VOLNAME_LEN); + if (volname[SUN_VOLNAME_LEN] != '\0') + warnx( +"%s, line %d: volume name longer than %d characters, truncating", + file, line + 1, SUN_VOLNAME_LEN); + } + continue; + } if (strlen(bp) < 2 || bp[1] != ':') { line++; continue; @@ -742,9 +770,11 @@ static void print_label(struct sun_disklabel *sl, const char *disk, FILE *out) { - int i; + int i, j; int havevtoc; uintmax_t secpercyl; + /* Long enough to hex-encode each character. */ + char volname[4 * SUN_VOLNAME_LEN + 1]; havevtoc = sl->sl_vtoc_sane == SUN_VTOC_SANE; secpercyl = sl->sl_nsectors * sl->sl_ntracks; @@ -763,11 +793,25 @@ "# max sectors/unit (including alt cylinders): %ju\n", (uintmax_t)mediasize / sectorsize); fprintf(out, -"sectors/unit: %ju\n" +"sectors/unit: %ju\n", + secpercyl * sl->sl_ncylinders); + if (havevtoc && sl->sl_vtoc_volname[0] != '\0') { + for (i = j = 0; i < SUN_VOLNAME_LEN; i++) { + if (sl->sl_vtoc_volname[i] == '\0') + break; + if (isprint(sl->sl_vtoc_volname[i])) + volname[j++] = sl->sl_vtoc_volname[i]; + else + j += sprintf(volname + j, "\\x%02X", + sl->sl_vtoc_volname[i]); + } + volname[j] = '\0'; + fprintf(out, "volume name: %s\n", volname); + } + fprintf(out, "\n" "%d partitions:\n" "#\n", - secpercyl * sl->sl_ncylinders, SUN_NPART); if (!hflag) { fprintf(out, "# Size is in %s.", cflag? "cylinders": "sectors"); ==== //depot/projects/wifi/sys/compat/ndis/subr_ntoskrnl.c#11 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.62 2005/03/28 20:46:08 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.63 2005/03/30 16:22:48 wpaul Exp $"); #include #include @@ -2575,11 +2575,11 @@ uint64_t curtime; uint8_t pending; - mtx_lock(&ntoskrnl_dispatchlock); - if (timer == NULL) return(FALSE); + mtx_lock(&ntoskrnl_dispatchlock); + if (timer->k_header.dh_inserted == TRUE) { untimeout(ntoskrnl_timercall, timer, timer->k_handle); timer->k_header.dh_inserted = FALSE; ==== //depot/projects/wifi/sys/conf/files#21 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1010 2005/03/22 14:52:37 sobomax Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1011 2005/03/30 12:03:37 sos Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -387,6 +387,7 @@ dev/an/if_an_pccard.c optional an pccard dev/an/if_an_pci.c optional an pci dev/asr/asr.c optional asr pci +dev/ata/ata_if.m optional ata dev/ata/ata-all.c optional ata dev/ata/ata-card.c optional ata pccard dev/ata/ata-cbus.c optional ata pc98 ==== //depot/projects/wifi/sys/conf/kmod.mk#10 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.185 2005/02/11 21:04:20 ru Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.186 2005/03/30 12:03:37 sos Exp $ # # The include file handles building and installing loadable # kernel modules. @@ -298,8 +298,9 @@ .endfor .endif -MFILES?= dev/acpica/acpi_if.m dev/eisa/eisa_if.m dev/iicbus/iicbb_if.m \ - dev/iicbus/iicbus_if.m dev/mii/miibus_if.m dev/ofw/ofw_bus_if.m \ +MFILES?= dev/acpica/acpi_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \ + dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \ + dev/mii/miibus_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ ==== //depot/projects/wifi/sys/conf/options#13 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.496 2005/03/14 16:04:26 des Exp $ +# $FreeBSD: src/sys/conf/options,v 1.497 2005/03/30 12:03:37 sos Exp $ # # On the handling of kernel options # @@ -303,12 +303,6 @@ # Options used in the 'ata' ATA/ATAPI driver ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h -DEV_ATADISK opt_ata.h -DEV_ATAPICD opt_ata.h -DEV_ATAPIST opt_ata.h -DEV_ATAPIFD opt_ata.h -DEV_ATAPICAM opt_ata.h -DEV_ATARAID opt_ata.h # Net stuff. ACCEPT_FILTER_DATA ==== //depot/projects/wifi/sys/dev/acpi_support/acpi_asus.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_asus.c,v 1.21 2005/03/24 21:07:55 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_asus.c,v 1.22 2005/03/30 15:06:11 philip Exp $"); /* * Driver for extra ACPI-controlled gadgets (hotkeys, leds, etc) found on @@ -79,8 +79,10 @@ }; struct acpi_asus_led { + struct acpi_asus_softc *sc; struct cdev *cdev; - device_t dev; + int busy; + int state; enum { ACPI_ASUS_LED_MLED, ACPI_ASUS_LED_TLED, @@ -255,6 +257,7 @@ static int acpi_asus_detach(device_t dev); static void acpi_asus_led(struct acpi_asus_led *led, int state); +static void acpi_asus_led_task(struct acpi_asus_led *led, int pending __unused); static int acpi_asus_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_asus_sysctl_init(struct acpi_asus_softc *sc, int method); @@ -401,21 +404,24 @@ /* Attach leds */ if (sc->model->mled_set) { - sc->s_mled.dev = dev; + sc->s_mled.busy = 0; + sc->s_mled.sc = sc; sc->s_mled.type = ACPI_ASUS_LED_MLED; sc->s_mled.cdev = led_create((led_t *)acpi_asus_led, &sc->s_mled, "mled"); } if (sc->model->tled_set) { - sc->s_tled.dev = dev; + sc->s_tled.busy = 0; + sc->s_tled.sc = sc; sc->s_tled.type = ACPI_ASUS_LED_TLED; sc->s_tled.cdev = led_create((led_t *)acpi_asus_led, &sc->s_tled, "tled"); } if (sc->model->wled_set) { - sc->s_wled.dev = dev; + sc->s_wled.busy = 0; + sc->s_wled.sc = sc; sc->s_wled.type = ACPI_ASUS_LED_WLED; sc->s_wled.cdev = led_create((led_t *)acpi_asus_led, &sc->s_wled, "wled"); @@ -461,27 +467,30 @@ } static void -acpi_asus_led(struct acpi_asus_led *led, int state) +acpi_asus_led_task(struct acpi_asus_led *led, int pending __unused) { struct acpi_asus_softc *sc; char *method; - + int state; + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - sc = device_get_softc(led->dev); + sc = led->sc; switch (led->type) { case ACPI_ASUS_LED_MLED: method = sc->model->mled_set; /* Note: inverted */ - state = !state; + state = !led->state; break; case ACPI_ASUS_LED_TLED: method = sc->model->tled_set; + state = led->state; break; case ACPI_ASUS_LED_WLED: method = sc->model->wled_set; + state = led->state; break; default: printf("acpi_asus_led: invalid LED type %d\n", @@ -490,6 +499,23 @@ } acpi_SetInteger(sc->handle, method, state); + led->busy = 0; +} + +static void +acpi_asus_led(struct acpi_asus_led *led, int state) +{ + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (led->busy) + return; + + led->busy = 1; + led->state = state; + + AcpiOsQueueForExecution(OSD_PRIORITY_LO, + (void *)acpi_asus_led_task, led); } static int ==== //depot/projects/wifi/sys/dev/ata/ata-all.c#4 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2004 Søren Schmidt + * Copyright (c) 1998 - 2005 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,13 +27,14 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.235 2005/02/07 17:14:42 mdodd Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.236 2005/03/30 12:03:37 sos Exp $"); #include "opt_ata.h" #include #include #include #include +#include #include #include #include @@ -51,33 +52,27 @@ #ifdef __alpha__ #include #endif -#include #include -#include -#include +#include +#include -/* device structures */ -static d_ioctl_t ata_ioctl; +/* device structure */ +static d_ioctl_t ata_ioctl; static struct cdevsw ata_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_ioctl = ata_ioctl, - .d_name = "ata", + .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, /* we need this as newbus isn't safe */ + .d_ioctl = ata_ioctl, + .d_name = "ata", }; /* prototypes */ -static void ata_shutdown(void *, int); static void ata_interrupt(void *); -static int ata_getparam(struct ata_device *, u_int8_t); -static void ata_identify_devices(struct ata_channel *); static void ata_boot_attach(void); -static void bswap(int8_t *, int); -static void btrim(int8_t *, int); -static void bpack(int8_t *, int8_t *, int); -static void ata_init(void); +device_t ata_add_child(driver_t *driver, device_t parent, struct ata_device *atadev, const char *name, int unit); /* global vars */ MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer"); +int (*ata_ioctl_func)(struct ata_cmd *iocmd) = NULL; devclass_t ata_devclass; uma_zone_t ata_zone; int ata_wc = 1; @@ -86,19 +81,18 @@ static struct intr_config_hook *ata_delayed_attach = NULL; static int ata_dma = 1; static int atapi_dma = 1; -static int ata_resuming = 0; /* sysctl vars */ SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); TUNABLE_INT("hw.ata.ata_dma", &ata_dma); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0, "ATA disk DMA mode control"); +TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); +SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0, + "ATAPI device DMA mode control"); TUNABLE_INT("hw.ata.wc", &ata_wc); SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLAG_RDTUN, &ata_wc, 0, "ATA disk write caching"); -TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); -SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0, - "ATAPI device DMA mode control"); /* * newbus device interface related functions @@ -106,231 +100,147 @@ int ata_probe(device_t dev) { - struct ata_channel *ch; - - if (!dev || !(ch = device_get_softc(dev))) - return ENXIO; - - if (ch->r_irq) - return EEXIST; - return 0; } int ata_attach(device_t dev) { - struct ata_channel *ch; + struct ata_channel *ch = device_get_softc(dev); int error, rid; - if (!dev || !(ch = device_get_softc(dev))) - return ENXIO; + /* check that we have a virgin channel to attach */ + if (ch->r_irq) + return EEXIST; /* initialize the softc basics */ - ch->device[MASTER].channel = ch; - ch->device[MASTER].unit = ATA_MASTER; - ch->device[MASTER].mode = ATA_PIO; - ch->device[SLAVE].channel = ch; - ch->device[SLAVE].unit = ATA_SLAVE; - ch->device[SLAVE].mode = ATA_PIO; ch->dev = dev; ch->state = ATA_IDLE; bzero(&ch->state_mtx, sizeof(struct mtx)); mtx_init(&ch->state_mtx, "ATA state lock", NULL, MTX_DEF); + bzero(&ch->queue_mtx, sizeof(struct mtx)); + mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); + TAILQ_INIT(&ch->ata_queue); /* initialise device(s) on this channel */ - while (ch->locking(ch, ATA_LF_LOCK) != ch->unit) + while (ATA_LOCKING(device_get_parent(dev), dev, ATA_LF_LOCK) != ch->unit) tsleep(&error, PRIBIO, "ataatch", 1); ch->hw.reset(ch); - ch->locking(ch, ATA_LF_UNLOCK); + ATA_LOCKING(device_get_parent(dev), dev, ATA_LF_UNLOCK); + /* setup interrupt delivery */ rid = ATA_IRQ_RID; ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (!ch->r_irq) { - ata_printf(ch, -1, "unable to allocate interrupt\n"); + device_printf(dev, "unable to allocate interrupt\n"); return ENXIO; } if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, ata_interrupt, ch, &ch->ih))) { - ata_printf(ch, -1, "unable to setup interrupt\n"); + device_printf(dev, "unable to setup interrupt\n"); return error; } - /* initialize queue and associated lock */ - bzero(&ch->queue_mtx, sizeof(struct mtx)); - mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); - TAILQ_INIT(&ch->ata_queue); - /* do not attach devices if we are in early boot */ if (ata_delayed_attach) return 0; - ata_identify_devices(ch); - - if (ch->device[MASTER].attach) - ch->device[MASTER].attach(&ch->device[MASTER]); - if (ch->device[SLAVE].attach) - ch->device[SLAVE].attach(&ch->device[SLAVE]); -#ifdef DEV_ATAPICAM - atapi_cam_attach_bus(ch); -#endif + /* probe and attach devices on this channel */ + bus_generic_probe(dev); + bus_generic_attach(dev); return 0; } int ata_detach(device_t dev) { - struct ata_channel *ch; + struct ata_channel *ch = device_get_softc(dev); + device_t *children; + int nchildren, i; - if (!dev || !(ch = device_get_softc(dev)) || !ch->r_irq) + /* check that we have a vaild channel to detach */ + if (!ch->r_irq) return ENXIO; - /* mark devices on this channel as detaching */ - ch->device[MASTER].flags |= ATA_D_DETACHING; - ch->device[SLAVE].flags |= ATA_D_DETACHING; + /* detach & delete all children */ + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) + if (children[i]) + device_delete_child(dev, children[i]); + free(children, M_TEMP); + } - /* fail outstanding requests on this channel */ + /* fail outstanding requests on this channel (SOS shouldn't be any XXX ) */ ata_fail_requests(ch, NULL); - /* unlock the channel */ - mtx_lock(&ch->state_mtx); - ch->state = ATA_IDLE; - mtx_unlock(&ch->state_mtx); - ch->locking(ch, ATA_LF_UNLOCK); - - /* detach devices on this channel */ - if (ch->device[MASTER].detach) - ch->device[MASTER].detach(&ch->device[MASTER]); - if (ch->device[SLAVE].detach) - ch->device[SLAVE].detach(&ch->device[SLAVE]); -#ifdef DEV_ATAPICAM - atapi_cam_detach_bus(ch); -#endif - - /* flush cache and powerdown device */ - if (ch->device[MASTER].param) { - if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE) - ata_controlcmd(&ch->device[MASTER], ATA_FLUSHCACHE, 0, 0, 0); - ata_controlcmd(&ch->device[MASTER], ATA_SLEEP, 0, 0, 0); - free(ch->device[MASTER].param, M_ATA); - ch->device[MASTER].param = NULL; - } - if (ch->device[SLAVE].param) { - if (ch->device[SLAVE].param->support.command2 & ATA_SUPPORT_FLUSHCACHE) - ata_controlcmd(&ch->device[SLAVE], ATA_FLUSHCACHE, 0, 0, 0); - ata_controlcmd(&ch->device[SLAVE], ATA_SLEEP, 0, 0, 0); - free(ch->device[SLAVE].param, M_ATA); - ch->device[SLAVE].param = NULL; - } - ch->device[MASTER].mode = ATA_PIO; - ch->device[SLAVE].mode = ATA_PIO; - ch->devices = 0; - + /* release resources */ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); ch->r_irq = NULL; + mtx_destroy(&ch->state_mtx); mtx_destroy(&ch->queue_mtx); return 0; } int -ata_reinit(struct ata_channel *ch) +ata_reinit(device_t dev) { - int devices, misdev, newdev; + struct ata_channel *ch = device_get_softc(dev); + device_t *children; + int nchildren, i; - if (!ch->r_irq) + if (!ch || !ch->r_irq) return ENXIO; if (bootverbose) - ata_printf(ch, -1, "reiniting channel ..\n"); + device_printf(dev, "reiniting channel ..\n"); - /* poll for locking of this channel */ - while (ch->locking(ch, ATA_LF_LOCK) != ch->unit) - tsleep(&devices, PRIBIO, "atarint", 1); + /* poll for locking the channel */ + while (ATA_LOCKING(device_get_parent(dev), dev, ATA_LF_LOCK) != ch->unit) + tsleep(&dev, PRIBIO, "atarini", 1); - ata_catch_inflight(ch); - - /* grap the channel lock no matter what */ + /* grap the channel lock */ mtx_lock(&ch->state_mtx); - ch->state = ATA_ACTIVE; + ch->state = ATA_STALL_QUEUE; mtx_unlock(&ch->state_mtx); - if (ch->flags & ATA_IMMEDIATE_MODE) - return EIO; - else - ch->flags |= ATA_IMMEDIATE_MODE; - - devices = ch->devices; - + /* reset the channel and devices */ ch->hw.reset(ch); - if (bootverbose) - ata_printf(ch, -1, "resetting done ..\n"); - - /* detach what left the channel during reset */ - if ((misdev = devices & ~ch->devices)) { - if ((misdev & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) && - ch->device[MASTER].detach) { - ata_fail_requests(ch, &ch->device[MASTER]); - ch->device[MASTER].detach(&ch->device[MASTER]); - free(ch->device[MASTER].param, M_ATA); - ch->device[MASTER].param = NULL; + /* reinit the children and delete any that fails */ + if (!device_get_children(dev, &children, &nchildren)) { + mtx_lock(&Giant); /* newbus suckage it needs Giant */ + for (i = 0; i < nchildren; i++) { + if (children[i] && device_is_attached(children[i])) >>> TRUNCATED FOR MAIL (1000 lines) <<<