PERFORCE change 124593 for review
Marko Zec
zec at FreeBSD.org
Fri Aug 3 06:28:20 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=124593
Change 124593 by zec at zec_tca51 on 2007/08/03 13:27:32
IFC @ 124552
Affected files ...
.. //depot/projects/vimage/src/sys/amd64/amd64/local_apic.c#6 integrate
.. //depot/projects/vimage/src/sys/amd64/amd64/mp_machdep.c#7 integrate
.. //depot/projects/vimage/src/sys/arm/arm/trap.c#4 integrate
.. //depot/projects/vimage/src/sys/arm/at91/at91rm92reg.h#2 integrate
.. //depot/projects/vimage/src/sys/arm/at91/kb920x_machdep.c#5 integrate
.. //depot/projects/vimage/src/sys/arm/at91/ohci_atmelarm.c#3 integrate
.. //depot/projects/vimage/src/sys/arm/conf/KB920X#3 integrate
.. //depot/projects/vimage/src/sys/conf/kern.pre.mk#6 integrate
.. //depot/projects/vimage/src/sys/conf/options.ia64#2 integrate
.. //depot/projects/vimage/src/sys/contrib/pf/net/if_pfsync.c#7 integrate
.. //depot/projects/vimage/src/sys/dev/acpica/acpi_hpet.c#6 integrate
.. //depot/projects/vimage/src/sys/dev/acpica/acpi_timer.c#4 integrate
.. //depot/projects/vimage/src/sys/dev/aic7xxx/aic7xxx.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/aic7xxx/aic_osm_lib.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/an/if_an.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/arcmsr/arcmsr.c#7 integrate
.. //depot/projects/vimage/src/sys/dev/bce/if_bce.c#9 integrate
.. //depot/projects/vimage/src/sys/dev/bce/if_bcefw.h#4 integrate
.. //depot/projects/vimage/src/sys/dev/bce/if_bcereg.h#6 integrate
.. //depot/projects/vimage/src/sys/dev/nmdm/nmdm.c#2 integrate
.. //depot/projects/vimage/src/sys/dev/pci/pci.c#9 integrate
.. //depot/projects/vimage/src/sys/dev/usb/umodem.c#4 integrate
.. //depot/projects/vimage/src/sys/i386/i386/local_apic.c#6 integrate
.. //depot/projects/vimage/src/sys/i386/i386/mp_machdep.c#7 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/db_machdep.c#3 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/exception.S#4 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/interrupt.c#4 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/machdep.c#7 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/mp_machdep.c#3 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/nexus.c#3 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/pmap.c#5 integrate
.. //depot/projects/vimage/src/sys/ia64/ia64/sapic.c#2 integrate
.. //depot/projects/vimage/src/sys/ia64/include/atomic.h#2 integrate
.. //depot/projects/vimage/src/sys/ia64/include/intr.h#3 integrate
.. //depot/projects/vimage/src/sys/ia64/include/md_var.h#2 integrate
.. //depot/projects/vimage/src/sys/ia64/include/sapicvar.h#2 integrate
.. //depot/projects/vimage/src/sys/net/bpf.c#10 integrate
.. //depot/projects/vimage/src/sys/net/if_bridge.c#6 integrate
.. //depot/projects/vimage/src/sys/net/if_bridgevar.h#5 integrate
.. //depot/projects/vimage/src/sys/net/if_lagg.c#8 integrate
.. //depot/projects/vimage/src/sys/net/if_lagg.h#6 integrate
.. //depot/projects/vimage/src/sys/netgraph/netgraph.h#3 integrate
.. //depot/projects/vimage/src/sys/netgraph/ng_ppp.c#7 integrate
.. //depot/projects/vimage/src/sys/netgraph/ng_ppp.h#3 integrate
.. //depot/projects/vimage/src/sys/netinet/ip_carp.c#4 integrate
.. //depot/projects/vimage/src/sys/netinet/ip_dummynet.c#4 integrate
.. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#21 edit
.. //depot/projects/vimage/src/sys/netinet/ip_mroute.c#5 integrate
.. //depot/projects/vimage/src/sys/netinet/tcp_fsm.h#3 integrate
.. //depot/projects/vimage/src/sys/netinet/tcp_input.c#20 integrate
.. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#25 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_syncache.c#16 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_timer.h#5 integrate
.. //depot/projects/vimage/src/sys/netinet/tcp_usrreq.c#11 integrate
.. //depot/projects/vimage/src/sys/netinet/tcp_var.h#14 edit
.. //depot/projects/vimage/src/sys/netipx/spx_debug.c#4 integrate
.. //depot/projects/vimage/src/sys/netipx/spx_debug.h#4 integrate
.. //depot/projects/vimage/src/sys/pc98/cbus/clock.c#5 integrate
.. //depot/projects/vimage/src/sys/pci/viapm.c#3 integrate
.. //depot/projects/vimage/src/sys/powerpc/powerpc/trap.c#4 integrate
.. //depot/projects/vimage/src/sys/sys/mutex.h#7 integrate
Differences ...
==== //depot/projects/vimage/src/sys/amd64/amd64/local_apic.c#6 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.40 2007/05/08 22:01:02 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.41 2007/08/02 21:17:58 peter Exp $");
#include "opt_hwpmc_hooks.h"
@@ -1060,10 +1060,6 @@
if (retval != 0)
printf("%s: Failed to setup the local APIC: returned %d\n",
best_enum->apic_name, retval);
-#ifdef SMP
- /* Last, setup the cpu topology now that we have probed CPUs */
- mp_topology();
-#endif
}
SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_FIRST, apic_setup_local, NULL)
==== //depot/projects/vimage/src/sys/amd64/amd64/mp_machdep.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.286 2007/06/04 23:56:07 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.287 2007/08/02 21:17:58 peter Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -186,26 +186,14 @@
mp_topology(void)
{
struct cpu_group *group;
- u_int regs[4];
- int logical_cpus;
int apic_id;
int groups;
int cpu;
/* Build the smp_topology map. */
/* Nothing to do if there is no HTT support. */
- if ((cpu_feature & CPUID_HTT) == 0)
+ if (hyperthreading_cpus <= 1)
return;
- logical_cpus = (cpu_procinfo & CPUID_HTT_CORES) >> 16;
- if (logical_cpus <= 1)
- return;
- /* Nothing to do if reported cores are physical cores. */
- if (strcmp(cpu_vendor, "GenuineIntel") == 0 && cpu_high >= 4) {
- cpuid_count(4, 0, regs);
- if ((regs[0] & 0x1f) != 0 &&
- logical_cpus <= ((regs[0] >> 26) & 0x3f) + 1)
- return;
- }
group = &mp_groups[0];
groups = 1;
for (cpu = 0, apic_id = 0; apic_id <= MAX_APIC_ID; apic_id++) {
@@ -215,7 +203,8 @@
* If the current group has members and we're not a logical
* cpu, create a new group.
*/
- if (group->cg_count != 0 && (apic_id % logical_cpus) == 0) {
+ if (group->cg_count != 0 &&
+ (apic_id % hyperthreading_cpus) == 0) {
group++;
groups++;
}
@@ -420,6 +409,9 @@
}
set_interrupt_apic_ids();
+
+ /* Last, setup the cpu topology now that we have probed CPUs */
+ mp_topology();
}
==== //depot/projects/vimage/src/sys/arm/arm/trap.c#4 (text+ko) ====
@@ -82,7 +82,7 @@
#include "opt_ktrace.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.34 2007/06/04 21:38:45 attilio Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.35 2007/07/31 17:09:05 cognet Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -943,7 +943,7 @@
case 0:
#ifdef __ARMEB__
if ((insn & 0x000fffff) == SYS___syscall &&
- (code != SYS_lseek)) {
+ code != SYS_freebsd6_lseek && code != SYS_lseek) {
/*
* 64-bit return, 32-bit syscall. Fixup byte order
*/
==== //depot/projects/vimage/src/sys/arm/at91/at91rm92reg.h#2 (text) ====
@@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.4 2006/08/28 20:05:00 cognet Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.5 2007/07/31 17:43:18 imp Exp $ */
#ifndef AT91RM92REG_H_
#define AT91RM92REG_H_
@@ -336,7 +336,8 @@
#define AT91RM92_TC1C1_BASE 0xffa4040
#define AT91RM92_TC1C2_BASE 0xffa4080
-#define AT91RM92_OHCI_BASE 0x00300000
+#define AT91RM92_OHCI_BASE 0xdfe00000
+#define AT91RM92_OHCI_PA_BASE 0x00300000
#define AT91RM92_OHCI_SIZE 0x00100000
#define AT91C_MASTER_CLOCK 60000000
==== //depot/projects/vimage/src/sys/arm/at91/kb920x_machdep.c#5 (text) ====
@@ -48,7 +48,7 @@
#include "opt_at91.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.22 2007/05/23 13:20:50 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.23 2007/07/31 17:43:18 imp Exp $");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
@@ -165,14 +165,14 @@
* initialization is done. However, the AT91 resource allocation
* system doesn't know how to use pmap_mapdev() yet.
*/
-#if 0
+#if 1
{
/*
* Add the ohci controller, and anything else that might be
* on this chip select for a VA/PA mapping.
*/
AT91RM92_OHCI_BASE,
- AT91RM92_OHCI_BASE,
+ AT91RM92_OHCI_PA_BASE,
AT91RM92_OHCI_SIZE,
VM_PROT_READ|VM_PROT_WRITE,
PTE_NOCACHE,
==== //depot/projects/vimage/src/sys/arm/at91/ohci_atmelarm.c#3 (text) ====
@@ -23,12 +23,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/ohci_atmelarm.c,v 1.2 2007/03/01 09:10:55 piso Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/ohci_atmelarm.c,v 1.3 2007/07/31 17:43:18 imp Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/module.h>
+#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/queue.h>
#include <machine/bus.h>
@@ -99,6 +101,30 @@
}
device_set_ivars(sc->sc_ohci.sc_bus.bdev, &sc->sc_ohci.sc_bus);
+ /* Allocate a parent dma tag for DMA maps */
+ err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0,
+ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+ BUS_SPACE_MAXSIZE_32BIT, USB_DMA_NSEG, BUS_SPACE_MAXSIZE_32BIT, 0,
+ NULL, NULL, &sc->sc_ohci.sc_bus.parent_dmatag);
+ if (err) {
+ device_printf(dev, "Could not allocate parent DMA tag (%d)\n",
+ err);
+ err = ENXIO;
+ goto error;
+ }
+
+ /* Allocate a dma tag for transfer buffers */
+ err = bus_dma_tag_create(sc->sc_ohci.sc_bus.parent_dmatag, 1, 0,
+ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+ BUS_SPACE_MAXSIZE_32BIT, USB_DMA_NSEG, BUS_SPACE_MAXSIZE_32BIT, 0,
+ busdma_lock_mutex, &Giant, &sc->sc_ohci.sc_bus.buffer_dmatag);
+ if (err) {
+ device_printf(dev, "Could not allocate transfer tag (%d)\n",
+ err);
+ err = ENXIO;
+ goto error;
+ }
+
err = bus_setup_intr(dev, sc->sc_ohci.irq_res, INTR_TYPE_BIO, NULL,
ohci_intr, sc, &sc->sc_ohci.ih);
if (err) {
@@ -158,6 +184,12 @@
bus_teardown_intr(dev, sc->sc_ohci.irq_res, sc->sc_ohci.ih);
sc->sc_ohci.ih = NULL;
}
+
+ if (sc->sc_ohci.sc_bus.parent_dmatag != NULL)
+ bus_dma_tag_destroy(sc->sc_ohci.sc_bus.parent_dmatag);
+ if (sc->sc_ohci.sc_bus.buffer_dmatag != NULL)
+ bus_dma_tag_destroy(sc->sc_ohci.sc_bus.buffer_dmatag);
+
if (sc->sc_ohci.sc_bus.bdev) {
device_delete_child(dev, sc->sc_ohci.sc_bus.bdev);
sc->sc_ohci.sc_bus.bdev = NULL;
==== //depot/projects/vimage/src/sys/arm/conf/KB920X#3 (text) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/arm/conf/KB920X,v 1.12 2007/03/23 23:47:59 imp Exp $
+# $FreeBSD: src/sys/arm/conf/KB920X,v 1.13 2007/07/31 17:45:54 imp Exp $
machine arm
ident KB920X
@@ -93,3 +93,47 @@
device icee
device bpf
+# USB support
+device ohci # OHCI localbus->USB interface
+device usb # USB Bus (required)
+#device udbp # USB Double Bulk Pipe devices
+device ugen # Generic
+device uhid # "Human Interface Devices"
+device ulpt # Printer
+device umass # Disks/Mass storage - Requires scbus and da
+device ural # Ralink Technology RT2500USB wireless NICs
+device rum # Ralink Technology RT2501USB wireless NICs
+device urio # Diamond Rio 500 MP3 player
+device uscanner # Scanners
+# USB Ethernet, requires miibus
+device miibus
+device aue # ADMtek USB Ethernet
+device axe # ASIX Electronics USB Ethernet
+device cdce # Generic USB over Ethernet
+device cue # CATC USB Ethernet
+device kue # Kawasaki LSI USB Ethernet
+device rue # RealTek RTL8150 USB Ethernet
+device udav
+# usb serial
+device ucom
+device uark
+device ubsa
+device ubser
+device uftdi
+device uipaq
+device uplcom
+device uvisor
+device uvscom
+# SCSI peripherals
+device scbus # SCSI bus (required for SCSI)
+device da # Direct Access (disks)
+device cd # CD
+device pass # Passthrough device (direct SCSI access)
+# Wireless NIC cards
+device wlan # 802.11 support
+device wlan_wep # 802.11 WEP support
+device wlan_ccmp # 802.11 CCMP support
+device wlan_tkip # 802.11 TKIP support
+device wlan_amrr # AMRR transmit rate control algorithm
+device wlan_scan_ap # 802.11 AP mode scanning
+device wlan_scan_sta # 802.11 STA mode scanning
==== //depot/projects/vimage/src/sys/conf/kern.pre.mk#6 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.90 2007/07/12 00:01:53 jfv Exp $
+# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.91 2007/07/31 03:15:32 marcel Exp $
# Part of a unified Makefile for building kernels. This part contains all
# of the definitions that need to be before %BEFORE_DEPEND.
@@ -88,7 +88,7 @@
CFLAGS+= --param inline-unit-growth=100
CFLAGS+= --param large-function-growth=1000
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || \
- ${MACHINE_ARCH} == "sparc64"
+ ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
WERROR?= -Werror
.endif
.endif
==== //depot/projects/vimage/src/sys/conf/options.ia64#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.ia64,v 1.27 2006/04/24 23:31:50 marcel Exp $
+# $FreeBSD: src/sys/conf/options.ia64,v 1.28 2007/07/30 22:42:33 marcel Exp $
# Options specific to the ia64 platform kernels
ITANIUM opt_global.h
@@ -11,6 +11,8 @@
COMPAT_IA32 opt_compat.h
+EXCEPTION_TRACING opt_xtrace.h
+
VGA_ALT_SEQACCESS opt_vga.h
VGA_DEBUG opt_vga.h
VGA_NO_FONT_LOADING opt_vga.h
==== //depot/projects/vimage/src/sys/contrib/pf/net/if_pfsync.c#7 (text+ko) ====
@@ -34,7 +34,7 @@
#include "opt_pf.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.35 2007/07/03 12:16:07 mlaier Exp $");
+__FBSDID("$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.36 2007/07/28 07:31:29 rwatson Exp $");
#ifdef DEV_BPF
#define NBPFILTER DEV_BPF
@@ -282,12 +282,12 @@
ifp->if_hdrlen = PFSYNC_HDRLEN;
pfsync_setmtu(pfsyncif, ETHERMTU);
#ifdef __FreeBSD__
- callout_init(&pfsyncif->sc_tmo, NET_CALLOUT_MPSAFE);
+ callout_init(&pfsyncif->sc_tmo, CALLOUT_MPSAFE);
#ifdef PFSYNC_TDB
- callout_init(&pfsyncif->sc_tdb_tmo, NET_CALLOUT_MPSAFE);
+ callout_init(&pfsyncif->sc_tdb_tmo, CALLOUT_MPSAFE);
#endif
- callout_init(&pfsyncif->sc_bulk_tmo, NET_CALLOUT_MPSAFE);
- callout_init(&pfsyncif->sc_bulkfail_tmo, NET_CALLOUT_MPSAFE);
+ callout_init(&pfsyncif->sc_bulk_tmo, CALLOUT_MPSAFE);
+ callout_init(&pfsyncif->sc_bulkfail_tmo, CALLOUT_MPSAFE);
#else
timeout_set(&pfsyncif->sc_tmo, pfsync_timeout, pfsyncif);
timeout_set(&pfsyncif->sc_tdb_tmo, pfsync_tdb_timeout, pfsyncif);
==== //depot/projects/vimage/src/sys/dev/acpica/acpi_hpet.c#6 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_hpet.c,v 1.10 2007/07/22 20:45:27 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_hpet.c,v 1.11 2007/07/30 15:21:26 njl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -70,7 +70,7 @@
.tc_get_timecount = hpet_get_timecount,
.tc_counter_mask = ~0u,
.tc_name = "HPET",
- .tc_quality = 2000,
+ .tc_quality = 900,
};
static u_int
==== //depot/projects/vimage/src/sys/dev/acpica/acpi_timer.c#4 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_timer.c,v 1.41 2007/06/04 18:25:03 dwmalone Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_timer.c,v 1.42 2007/07/30 15:21:26 njl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -96,7 +96,7 @@
0, /* no default counter_mask */
0, /* no default frequency */
"ACPI", /* name */
- 1000 /* quality */
+ -1 /* quality (chosen later) */
};
static u_int
@@ -185,9 +185,11 @@
if (j == 10) {
acpi_timer_timecounter.tc_name = "ACPI-fast";
acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount;
+ acpi_timer_timecounter.tc_quality = 1000;
} else {
acpi_timer_timecounter.tc_name = "ACPI-safe";
acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe;
+ acpi_timer_timecounter.tc_quality = 850;
}
tc_init(&acpi_timer_timecounter);
==== //depot/projects/vimage/src/sys/dev/aic7xxx/aic7xxx.c#3 (text+ko) ====
@@ -46,7 +46,7 @@
#include "aicasm/aicasm_insformat.h"
#else
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.111 2007/04/19 18:53:52 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.112 2007/07/31 20:11:02 scottl Exp $");
#include <dev/aic7xxx/aic7xxx_osm.h>
#include <dev/aic7xxx/aic7xxx_inline.h>
#include <dev/aic7xxx/aicasm/aicasm_insformat.h>
@@ -6932,7 +6932,6 @@
struct ahc_softc *ahc;
ahc = scb->ahc_softc;
- ahc_lock(ahc);
if ((scb->flags & SCB_ACTIVE) != 0) {
if ((scb->flags & SCB_TIMEDOUT) == 0) {
LIST_INSERT_HEAD(&ahc->timedout_scbs, scb,
@@ -6941,7 +6940,6 @@
}
ahc_wakeup_recovery_thread(ahc);
}
- ahc_unlock(ahc);
}
/*
==== //depot/projects/vimage/src/sys/dev/aic7xxx/aic_osm_lib.c#3 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.c,v 1.5 2007/04/17 06:26:25 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.c,v 1.6 2007/07/31 20:11:03 scottl Exp $");
static void aic_recovery_thread(void *arg);
@@ -120,9 +120,7 @@
if ((aic->flags & AIC_SHUTDOWN_RECOVERY) != 0)
break;
- aic_unlock(aic);
aic_recover_commands(aic);
- aic_lock(aic);
}
aic->platform_data->recovery_thread = NULL;
wakeup(aic->platform_data);
==== //depot/projects/vimage/src/sys/dev/an/if_an.c#3 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.81 2007/06/08 01:21:20 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.82 2007/08/02 02:20:19 avatar Exp $");
/*
* The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form.
@@ -1914,7 +1914,9 @@
error = 0;
break;
case SIOCGAIRONET:
+ AN_UNLOCK(sc);
error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq));
+ AN_LOCK(sc);
if (error != 0)
break;
#ifdef ANCACHE
@@ -1940,12 +1942,16 @@
error = EINVAL;
break;
}
+ AN_UNLOCK(sc);
error = copyout(&sc->areq, ifr->ifr_data, sizeof(sc->areq));
+ AN_LOCK(sc);
break;
case SIOCSAIRONET:
if ((error = priv_check(td, PRIV_DRIVER)))
goto out;
+ AN_UNLOCK(sc);
error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq));
+ AN_LOCK(sc);
if (error != 0)
break;
an_setdef(sc, &sc->areq);
@@ -1953,7 +1959,9 @@
case SIOCGPRIVATE_0: /* used by Cisco client utility */
if ((error = priv_check(td, PRIV_DRIVER)))
goto out;
+ AN_UNLOCK(sc);
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
+ AN_LOCK(sc);
if (error)
goto out;
mode = l_ioctl.command;
@@ -1969,18 +1977,24 @@
}
if (!error) {
/* copy out the updated command info */
+ AN_UNLOCK(sc);
error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl));
+ AN_LOCK(sc);
}
break;
case SIOCGPRIVATE_1: /* used by Cisco client utility */
if ((error = priv_check(td, PRIV_DRIVER)))
goto out;
+ AN_UNLOCK(sc);
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
+ AN_LOCK(sc);
if (error)
goto out;
l_ioctl.command = 0;
error = AIROMAGIC;
+ AN_UNLOCK(sc);
(void) copyout(&error, l_ioctl.data, sizeof(error));
+ AN_LOCK(sc);
error = 0;
break;
case SIOCG80211:
@@ -2030,8 +2044,10 @@
ireq->i_len = len;
bzero(tmpstr, IEEE80211_NWID_LEN);
bcopy(tmpptr, tmpstr, len);
+ AN_UNLOCK(sc);
error = copyout(tmpstr, ireq->i_data,
IEEE80211_NWID_LEN);
+ AN_LOCK(sc);
break;
case IEEE80211_IOC_NUMSSIDS:
sc->areq.an_len = sizeof(sc->areq);
@@ -2105,7 +2121,9 @@
*/
bzero(tmpstr, len);
ireq->i_len = len;
+ AN_UNLOCK(sc);
error = copyout(tmpstr, ireq->i_data, len);
+ AN_LOCK(sc);
break;
case IEEE80211_IOC_NUMWEPKEYS:
ireq->i_val = 9; /* include home key */
@@ -2183,8 +2201,10 @@
tmpptr = config->an_nodename;
bzero(tmpstr, IEEE80211_NWID_LEN);
bcopy(tmpptr, tmpstr, ireq->i_len);
+ AN_UNLOCK(sc);
error = copyout(tmpstr, ireq->i_data,
IEEE80211_NWID_LEN);
+ AN_LOCK(sc);
break;
case IEEE80211_IOC_CHANNEL:
sc->areq.an_type = AN_RID_STATUS;
@@ -2268,9 +2288,11 @@
error = EINVAL;
break;
} else {
+ AN_UNLOCK(sc);
error = copyin(ireq->i_data,
ssids->an_entry[ireq->i_val].an_ssid,
ireq->i_len);
+ AN_LOCK(sc);
ssids->an_entry[ireq->i_val].an_len
= ireq->i_len;
break;
@@ -2305,7 +2327,9 @@
error = EINVAL;
break;
}
+ AN_UNLOCK(sc);
error = copyin(ireq->i_data, tmpstr, 13);
+ AN_LOCK(sc);
if (error != 0)
break;
/*
@@ -2387,8 +2411,10 @@
break;
}
bzero(config->an_nodename, 16);
+ AN_UNLOCK(sc);
error = copyin(ireq->i_data,
config->an_nodename, ireq->i_len);
+ AN_LOCK(sc);
break;
case IEEE80211_IOC_CHANNEL:
/*
@@ -2430,7 +2456,9 @@
an_setdef(sc, &sc->areq);
break;
default:
+ AN_UNLOCK(sc);
error = ether_ioctl(ifp, command, data);
+ AN_LOCK(sc);
break;
}
out:
@@ -3159,6 +3187,7 @@
{
unsigned short rid;
struct an_softc *sc;
+ int error;
switch (l_ioctl->command) {
case AIROGCAP:
@@ -3210,24 +3239,30 @@
l_ioctl->len = sc->areq.an_len - 4; /* just data */
+ AN_UNLOCK(sc);
/* the data contains the length at first */
if (copyout(&(sc->areq.an_len), l_ioctl->data,
sizeof(sc->areq.an_len))) {
- return -EFAULT;
+ error = -EFAULT;
+ goto lock_exit;
}
/* Just copy the data back */
if (copyout(&(sc->areq.an_val), l_ioctl->data + 2,
l_ioctl->len)) {
- return -EFAULT;
+ error = -EFAULT;
+ goto lock_exit;
}
- return 0;
+ error = 0;
+lock_exit:
+ AN_LOCK(sc);
+ return (error);
}
static int
writerids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl)
{
struct an_softc *sc;
- int rid, command;
+ int rid, command, error;
sc = ifp->if_softc;
rid = 0;
@@ -3269,16 +3304,20 @@
an_read_record(sc, (struct an_ltv_gen *)&sc->areq);
l_ioctl->len = sc->areq.an_len - 4; /* just data */
+ AN_UNLOCK(sc);
/* the data contains the length at first */
- if (copyout(&(sc->areq.an_len), l_ioctl->data,
- sizeof(sc->areq.an_len))) {
+ error = copyout(&(sc->areq.an_len), l_ioctl->data,
+ sizeof(sc->areq.an_len));
+ if (error) {
+ AN_LOCK(sc);
return -EFAULT;
}
/* Just copy the data */
- if (copyout(&(sc->areq.an_val), l_ioctl->data + 2,
- l_ioctl->len)) {
+ error = copyout(&(sc->areq.an_val), l_ioctl->data + 2,
+ l_ioctl->len);
+ AN_LOCK(sc);
+ if (error)
return -EFAULT;
- }
return 0;
break;
case AIROPWEPKEY:
@@ -3304,10 +3343,13 @@
sc->areq.an_type = rid;
/* Just copy the data back */
- if (copyin((l_ioctl->data) + 2, &sc->areq.an_val,
- l_ioctl->len)) {
+ AN_UNLOCK(sc);
+ error = copyin((l_ioctl->data) + 2, &sc->areq.an_val,
+ l_ioctl->len);
+ AN_LOCK(sc);
+ if (error)
return -EFAULT;
- }
+
an_cmd(sc, AN_CMD_DISABLE, 0);
an_write_record(sc, (struct an_ltv_gen *)&sc->areq);
an_cmd(sc, AN_CMD_ENABLE, 0);
@@ -3603,7 +3645,9 @@
return ENOBUFS;
break;
case AIROFLSHGCHR: /* Get char from aux */
+ AN_UNLOCK(sc);
status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len);
+ AN_LOCK(sc);
if (status)
return status;
z = *(int *)&sc->areq;
@@ -3612,7 +3656,9 @@
else
return -1;
case AIROFLSHPCHR: /* Send char to card. */
+ AN_UNLOCK(sc);
status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len);
+ AN_LOCK(sc);
if (status)
return status;
z = *(int *)&sc->areq;
@@ -3627,7 +3673,9 @@
l_ioctl->len, FLASH_SIZE);
return -EINVAL;
}
+ AN_UNLOCK(sc);
status = copyin(l_ioctl->data, sc->an_flash_buffer, l_ioctl->len);
+ AN_LOCK(sc);
if (status)
return status;
==== //depot/projects/vimage/src/sys/dev/arcmsr/arcmsr.c#7 (text+ko) ====
@@ -56,7 +56,7 @@
** and cause g_vfs_done() read write error
******************************************************************************************
-* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.23 2007/06/17 05:55:48 scottl Exp $
+* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.24 2007/07/31 20:16:50 scottl Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -103,6 +103,7 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#define ARCMSR_LOCK_INIT(l, s) mtx_init(l, s, NULL, MTX_DEF|MTX_RECURSE)
+ #define ARCMSR_LOCK_DESTROY(l) mtx_destroy(l)
#define ARCMSR_LOCK_ACQUIRE(l) mtx_lock(l)
#define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l)
#define ARCMSR_LOCK_TRY(l) mtx_trylock(l)
@@ -113,6 +114,7 @@
#include <pci/pcivar.h>
#include <pci/pcireg.h>
#define ARCMSR_LOCK_INIT(l, s) simple_lock_init(l)
+ #define ARCMSR_LOCK_DESTROY(l)
#define ARCMSR_LOCK_ACQUIRE(l) simple_lock(l)
#define ARCMSR_LOCK_RELEASE(l) simple_unlock(l)
#define ARCMSR_LOCK_TRY(l) simple_lock_try(l)
@@ -417,7 +419,6 @@
bus_dmamap_sync(acb->dm_segs_dmat, srb->dm_segs_dmamap, op);
bus_dmamap_unload(acb->dm_segs_dmat, srb->dm_segs_dmamap);
}
- ARCMSR_LOCK_ACQUIRE(&acb->workingQ_done_lock);
if(stand_flag==1) {
atomic_subtract_int(&acb->srboutstandingcount, 1);
if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && (
@@ -431,7 +432,6 @@
acb->srbworkingQ[acb->workingsrb_doneindex]=srb;
acb->workingsrb_doneindex++;
acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM;
- ARCMSR_LOCK_RELEASE(&acb->workingQ_done_lock);
xpt_done(pccb);
return;
}
@@ -671,6 +671,18 @@
**********************************************************************
**********************************************************************
*/
+static void arcmsr_intr_handler(void *arg)
+{
+ struct AdapterControlBlock *acb=(struct AdapterControlBlock *)arg;
+
+ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
+ arcmsr_interrupt(acb);
+ ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock);
+}
+/*
+**********************************************************************
+**********************************************************************
+*/
static void arcmsr_interrupt(void *arg)
{
struct AdapterControlBlock *acb=(struct AdapterControlBlock *)arg;
@@ -1035,7 +1047,6 @@
struct CommandControlBlock *srb=NULL;
u_int32_t workingsrb_startindex, workingsrb_doneindex;
- ARCMSR_LOCK_ACQUIRE(&acb->workingQ_start_lock);
workingsrb_doneindex=acb->workingsrb_doneindex;
workingsrb_startindex=acb->workingsrb_startindex;
srb=acb->srbworkingQ[workingsrb_startindex];
@@ -1046,7 +1057,6 @@
} else {
srb=NULL;
}
- ARCMSR_LOCK_RELEASE(&acb->workingQ_start_lock);
return(srb);
}
/*
@@ -1970,7 +1980,7 @@
/*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
/*flags*/ 0,
/*lockfunc*/ busdma_lock_mutex,
- /*lockarg*/ &Giant,
+ /*lockarg*/ &acb->qbuffer_lock,
&acb->dm_segs_dmat) != 0)
#else
if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat,
@@ -2114,9 +2124,10 @@
printf("arcmsr%d: cannot allocate softc\n", unit);
return (ENOMEM);
}
- bzero(acb, sizeof(struct AdapterControlBlock));
+ ARCMSR_LOCK_INIT(&acb->qbuffer_lock, "arcmsr Q buffer lock");
if(arcmsr_initialize(dev)) {
printf("arcmsr%d: initialize failure!\n", unit);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
return ENXIO;
}
/* After setting up the adapter, map our interrupt */
@@ -2124,8 +2135,9 @@
irqres=bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE);
if(irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE
- , NULL, arcmsr_interrupt, acb, &acb->ih)) {
+ , NULL, arcmsr_intr_handler, acb, &acb->ih)) {
arcmsr_free_resource(acb);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
printf("arcmsr%d: unable to register interrupt handler!\n", unit);
return ENXIO;
}
@@ -2142,23 +2154,27 @@
if(devq == NULL) {
arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
printf("arcmsr%d: cam_simq_alloc failure!\n", unit);
return ENXIO;
}
acb->psim=cam_sim_alloc(arcmsr_action, arcmsr_poll,
- "arcmsr", acb, unit, &Giant, 1,
+ "arcmsr", acb, unit, &acb->qbuffer_lock, 1,
ARCMSR_MAX_OUTSTANDING_CMD, devq);
if(acb->psim == NULL) {
arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
cam_simq_free(devq);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
printf("arcmsr%d: cam_sim_alloc failure!\n", unit);
return ENXIO;
}
+ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
if(xpt_bus_register(acb->psim, dev, 0) != CAM_SUCCESS) {
arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
cam_sim_free(acb->psim, /*free_devq*/TRUE);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
printf("arcmsr%d: xpt_bus_register failure!\n", unit);
return ENXIO;
}
@@ -2170,12 +2186,10 @@
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
xpt_bus_deregister(cam_sim_path(acb->psim));
cam_sim_free(acb->psim, /* free_simq */ TRUE);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
printf("arcmsr%d: xpt_create_path failure!\n", unit);
return ENXIO;
}
- ARCMSR_LOCK_INIT(&acb->workingQ_done_lock, "arcmsr done working Q lock");
- ARCMSR_LOCK_INIT(&acb->workingQ_start_lock, "arcmsr start working Q lock");
- ARCMSR_LOCK_INIT(&acb->qbuffer_lock, "arcmsr Q buffer lock");
/*
****************************************************
*/
@@ -2185,6 +2199,7 @@
csa.callback=arcmsr_async;
csa.callback_arg=acb->psim;
xpt_action((union ccb *)&csa);
+ ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock);
/* Create the control device. */
acb->ioctl_dev=make_dev(&arcmsr_cdevsw
, unit
@@ -2256,6 +2271,7 @@
struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev);
/* stop adapter background rebuild */
+ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
arcmsr_stop_adapter_bgrb(acb);
arcmsr_flush_adapter_cache(acb);
/* disable all outbound interrupt */
@@ -2289,6 +2305,7 @@
atomic_set_int(&acb->srboutstandingcount, 0);
acb->workingsrb_doneindex=0;
acb->workingsrb_startindex=0;
+ ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock);
return;
}
/*
@@ -2299,15 +2316,18 @@
{
struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev);
+ bus_teardown_intr(dev, acb->irqres, acb->ih);
arcmsr_shutdown(dev);
arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), acb->sys_res_arcmsr);
- bus_teardown_intr(dev, acb->irqres, acb->ih);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
+ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
xpt_async(AC_LOST_DEVICE, acb->ppath, NULL);
xpt_free_path(acb->ppath);
xpt_bus_deregister(cam_sim_path(acb->psim));
cam_sim_free(acb->psim, TRUE);
+ ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock);
+ ARCMSR_LOCK_DESTROY(&acb->qbuffer_lock);
return (0);
}
==== //depot/projects/vimage/src/sys/dev/bce/if_bce.c#9 (text) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.33 2007/06/16 02:27:03 davidch Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.34 2007/07/31 00:06:04 davidch Exp $");
/*
* The following controllers are supported by this driver:
@@ -288,21 +288,22 @@
static int bce_get_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *, u32 *);
static int bce_init_tx_chain (struct bce_softc *);
+static void bce_fill_rx_chain (struct bce_softc *);
static int bce_init_rx_chain (struct bce_softc *);
static void bce_free_rx_chain (struct bce_softc *);
static void bce_free_tx_chain (struct bce_softc *);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list