diff options
author | ps <ps@FreeBSD.org> | 2003-12-02 07:57:20 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2003-12-02 07:57:20 +0000 |
commit | 3a0af1aae72ca3322637a9d2f7f8b765835748c7 (patch) | |
tree | ba946a6caff762ad522eba49b289c9bb061bd1d4 /sys/dev/twe/twe_compat.h | |
parent | 61573506be17296e8a4f3b70686c75fb30900e65 (diff) | |
download | FreeBSD-src-3a0af1aae72ca3322637a9d2f7f8b765835748c7.zip FreeBSD-src-3a0af1aae72ca3322637a9d2f7f8b765835748c7.tar.gz |
After extensive QA cycles at 3ware, bring the driver in-line with all the
issues which they found and asked to be changed so 3ware can offcially
support the driver.
Summary of the most significant changes:
- TWE_OVERRIDE is no longer supported
- If twe_getparam failed, bogus data would be returned to the caller
- Cache the device unit in the twe_drive structure to aid debugging
- Add the 3ware driver version.
- Proper return error codes for many functions.
- Track the minimum queue length statistics
- 4.x compat: use the cached unit number from the twe_drive structure
instead of the the cached si_drv2. 3ware found that after many loads
and unloads that si_drv2 became corrupted. This did not happen in
-current.
Submitted by: Vinod Kashyap (with modifications by me)
Approved by: re (rwatson)
Diffstat (limited to 'sys/dev/twe/twe_compat.h')
-rw-r--r-- | sys/dev/twe/twe_compat.h | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/sys/dev/twe/twe_compat.h b/sys/dev/twe/twe_compat.h index 981199a..78922a6 100644 --- a/sys/dev/twe/twe_compat.h +++ b/sys/dev/twe/twe_compat.h @@ -1,5 +1,7 @@ /*- * Copyright (c) 2000 Michael Smith + * Copyright (c) 2003 Paul Saab + * Copyright (c) 2003 Vinod Kashyap * Copyright (c) 2000 BSDi * All rights reserved. * @@ -56,43 +58,9 @@ #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> -/* - * These macros allows us to build a version of the driver which can - * safely be loaded into a kernel which already contains a 'twe' driver, - * and which will override it in all things. - * - * All public symbols must be listed here. - */ -#ifdef TWE_OVERRIDE -#define twe_setup Xtwe_setup -#define twe_init Xtwe_init -#define twe_deinit Xtwe_deinit -#define twe_intr Xtwe_intr -#define twe_submit_bio Xtwe_submit_bio -#define twe_ioctl Xtwe_ioctl -#define twe_describe_controller Xtwe_describe_controller -#define twe_print_controller Xtwe_print_controller -#define twe_enable_interrupts Xtwe_enable_interrupts -#define twe_disable_interrupts Xtwe_disable_interrupts -#define twe_attach_drive Xtwe_attach_drive -#define twed_intr Xtwed_intr -#define twe_allocate_request Xtwe_allocate_request -#define twe_free_request Xtwe_free_request -#define twe_map_request Xtwe_map_request -#define twe_unmap_request Xtwe_unmap_request -#define twe_describe_code Xtwe_describe_code -#define twe_table_status Xtwe_table_status -#define twe_table_unitstate Xtwe_table_unitstate -#define twe_table_unittype Xtwe_table_unittype -#define twe_table_aen Xtwe_table_aen -#define TWE_DRIVER_NAME Xtwe -#define TWED_DRIVER_NAME Xtwed -#define TWE_MALLOC_CLASS M_XTWE -#else #define TWE_DRIVER_NAME twe #define TWED_DRIVER_NAME twed #define TWE_MALLOC_CLASS M_TWE -#endif /* * Wrappers for bus-space actions @@ -142,6 +110,7 @@ #if __FreeBSD_version < 500003 # include <machine/clock.h> # define INTR_ENTROPY 0 +# define FREEBSD_4 # include <sys/buf.h> /* old buf style */ typedef struct buf twe_bio; @@ -164,6 +133,7 @@ typedef struct buf_queue_head twe_bioq; # define TWE_BIO_STATS_END(bp) devstat_end_transaction_buf(&((struct twed_softc *)TWE_BIO_SOFTC(bp))->twed_stats, bp) #else # include <sys/bio.h> +# include <geom/geom_disk.h> typedef struct bio twe_bio; typedef struct bio_queue_head twe_bioq; # define TWE_BIO_QINIT(bq) bioq_init(&bq); |