From 8e7e6335bc8a905e3af8dfc41b13c606348d21e6 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 14 Feb 2010 17:14:11 +0000 Subject: [PATCH] Diff reduction with Adaptec's vendor driver. Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver. --- sys/dev/aac/aac.c | 19 +++++++++++-------- sys/dev/aac/aac_cam.c | 12 ++++++------ sys/dev/aac/aacreg.h | 2 +- sys/dev/aac/aacvar.h | 10 ++++++++++ 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 5839895e5062..0bcac8f7e5fe 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. */ -#define AAC_DRIVER_VERSION 0x02000000 #define AAC_DRIVERNAME "aac" #include "opt_aac.h" @@ -2767,10 +2766,8 @@ aac_describe_controller(struct aac_softc *sc) } device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", adapter_type, - AAC_DRIVER_VERSION >> 24, - (AAC_DRIVER_VERSION >> 16) & 0xFF, - AAC_DRIVER_VERSION & 0xFF, - AAC_DRIVER_BUILD); + AAC_DRIVER_MAJOR_VERSION, AAC_DRIVER_MINOR_VERSION, + AAC_DRIVER_BUGFIX_LEVEL, AAC_DRIVER_BUILD); aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); @@ -3255,10 +3252,16 @@ aac_rev_check(struct aac_softc *sc, caddr_t udata) * Doctor up the response struct. */ rev_check_resp.possiblyCompatible = 1; - rev_check_resp.adapterSWRevision.external.ul = - sc->aac_revision.external.ul; + rev_check_resp.adapterSWRevision.external.comp.major = + AAC_DRIVER_MAJOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.minor = + AAC_DRIVER_MINOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.type = + AAC_DRIVER_TYPE; + rev_check_resp.adapterSWRevision.external.comp.dash = + AAC_DRIVER_BUGFIX_LEVEL; rev_check_resp.adapterSWRevision.buildNumber = - sc->aac_revision.buildNumber; + AAC_DRIVER_BUILD; return(copyout((caddr_t)&rev_check_resp, udata, sizeof(struct aac_rev_check_resp))); diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c index 37f7c637c30c..ba3fb9d69d5f 100644 --- a/sys/dev/aac/aac_cam.c +++ b/sys/dev/aac/aac_cam.c @@ -405,10 +405,10 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb) if (ccb->ccb_h.flags & CAM_DATA_PHYS) { /* Send a 32bit command */ fib->Header.Command = ScsiPortCommand; - srb->sg_map32.SgCount = 1; - srb->sg_map32.SgEntry[0].SgAddress = + srb->sg_map.SgCount = 1; + srb->sg_map.SgEntry[0].SgAddress = (uint32_t)(uintptr_t)csio->data_ptr; - srb->sg_map32.SgEntry[0].SgByteCount = + srb->sg_map.SgEntry[0].SgByteCount = csio->dxfer_len; } else { /* @@ -417,15 +417,15 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb) */ cm->cm_data = (void *)csio->data_ptr; cm->cm_datalen = csio->dxfer_len; - cm->cm_sgtable = &srb->sg_map32; + cm->cm_sgtable = &srb->sg_map; } } else { /* XXX Need to handle multiple s/g elements */ panic("aac_cam: multiple s/g elements"); } } else { - srb->sg_map32.SgCount = 0; - srb->sg_map32.SgEntry[0].SgByteCount = 0; + srb->sg_map.SgCount = 0; + srb->sg_map.SgEntry[0].SgByteCount = 0; srb->data_len = 0; } diff --git a/sys/dev/aac/aacreg.h b/sys/dev/aac/aacreg.h index 323588176354..5c849664a476 100644 --- a/sys/dev/aac/aacreg.h +++ b/sys/dev/aac/aacreg.h @@ -1374,7 +1374,7 @@ struct aac_srb { u_int32_t retry_limit; u_int32_t cdb_len; u_int8_t cdb[16]; - struct aac_sg_table sg_map32; + struct aac_sg_table sg_map; }; enum { diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h index 23ec83cbcca5..3ecb262ca7eb 100644 --- a/sys/dev/aac/aacvar.h +++ b/sys/dev/aac/aacvar.h @@ -37,6 +37,16 @@ #include #include +#define AAC_TYPE_DEVO 1 +#define AAC_TYPE_ALPHA 2 +#define AAC_TYPE_BETA 3 +#define AAC_TYPE_RELEASE 4 + +#define AAC_DRIVER_MAJOR_VERSION 2 +#define AAC_DRIVER_MINOR_VERSION 1 +#define AAC_DRIVER_BUGFIX_LEVEL 9 +#define AAC_DRIVER_TYPE AAC_TYPE_RELEASE + #ifndef AAC_DRIVER_BUILD # define AAC_DRIVER_BUILD 1 #endif