From 2063b35805f0b419312a484ee966760843b128cb Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 11 Jul 2012 17:32:08 +0200 Subject: [PATCH] amr(4): Make AMR_DEBUG a kernel configuration option. --- share/man/man4/amr.4 | 10 +++++++++- sys/conf/options | 1 + sys/config/LINT | 1 + sys/config/LINT64 | 1 + sys/dev/raid/amr/Makefile | 4 +--- sys/dev/raid/amr/amr.c | 2 ++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/share/man/man4/amr.4 b/share/man/man4/amr.4 index 000be24aff..42a1716865 100644 --- a/share/man/man4/amr.4 +++ b/share/man/man4/amr.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD: src/share/man/man4/amr.4,v 1.35 2006/06/18 14:45:28 brueffer Exp $ .\" -.Dd December 3, 2010 +.Dd July 11, 2012 .Dt AMR 4 .Os .Sh NAME @@ -39,6 +39,10 @@ kernel configuration file: .Cd "device amr" .Ed .Pp +To compile in debugging code: +.Cd options AMR_DEBUG=x # x=3 is maximum verbosity +.Ed +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : @@ -156,6 +160,10 @@ Intel RAID Controller SRCS16 Intel RAID Controller SRCU42X .El .Sh DIAGNOSTICS +Compiling with +.Dv AAC_DEBUG +will enable debug messages. +.Pp .Ss Driver initialisation/shutdown phase .Bl -diag .It amr%d: memory window not available diff --git a/sys/conf/options b/sys/conf/options index 9fd4f0a71d..a74fd9c5f5 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -65,6 +65,7 @@ AHD_REG_PRETTY_PRINT opt_aic79xx.h # Print register bitfields in debug ADW_ALLOW_MEMIO opt_adw.h # Allow PCI devices to use memory # mapped I/O +AMR_DEBUG opt_amr.h TWA_DEBUG opt_twa.h #options for ACPI support diff --git a/sys/config/LINT b/sys/config/LINT index 4400202c78..053c1c6889 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -1221,6 +1221,7 @@ device ida # Compaq Smart RAID device mlx # Mylex DAC960 device amr # AMI MegaRAID device amrp # SCSI Passthrough interface (optional, CAM req.) +options AMR_DEBUG=3 device mfi # LSI MegaRAID SAS device mfip # LSI MegaRAID SAS passthrough, requires CAM options MFI_DEBUG diff --git a/sys/config/LINT64 b/sys/config/LINT64 index 252bc3ffee..b34eab467f 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -1039,6 +1039,7 @@ device ida # Compaq Smart RAID device mlx # Mylex DAC960 device amr # AMI MegaRAID device amrp # SCSI Passthrough interface (optional, CAM req.) +options AMR_DEBUG=3 device mfi # LSI MegaRAID SAS device mfip # LSI MegaRAID SAS passthrough, requires CAM options MFI_DEBUG diff --git a/sys/dev/raid/amr/Makefile b/sys/dev/raid/amr/Makefile index 802cd5e38b..6a1f68ae02 100644 --- a/sys/dev/raid/amr/Makefile +++ b/sys/dev/raid/amr/Makefile @@ -7,11 +7,9 @@ SUBDIR= amr_cam KMOD= amr SRCS= amr.c amr_pci.c amr_disk.c device_if.h bus_if.h pci_if.h +SRCS+= opt_amr.h # Enable a questionable optimisation for newer adapters #CFLAGS+= -DAMR_QUARTZ_GOFASTER -# Debugging -#CFLAGS+= -DAMR_DEBUG=3 - .include diff --git a/sys/dev/raid/amr/amr.c b/sys/dev/raid/amr/amr.c index 6e0eb2a6eb..f1d773f816 100644 --- a/sys/dev/raid/amr/amr.c +++ b/sys/dev/raid/amr/amr.c @@ -61,6 +61,8 @@ * Driver for the AMI MegaRaid family of controllers. */ +#include "opt_amr.h" + #include #include #include -- 2.41.0