summaryrefslogtreecommitdiff
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2008-03-28 19:07:25 +0000
committerEd Maste <emaste@FreeBSD.org>2008-03-28 19:07:25 +0000
commit6d307336b3b3b439f973866b801aa8ac9dfe1cd9 (patch)
tree26454ea9a77fab47cf6a404131c1c2fc28e2d206 /sys/dev/aac
parenta6b39657438de3d037cb85deaa336c00ca65ab18 (diff)
Notes
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index eb881563548a..8f292627cf58 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -226,6 +226,7 @@ static int aac_return_aif(struct aac_softc *sc,
struct aac_fib_context *ctx, caddr_t uptr);
static int aac_query_disk(struct aac_softc *sc, caddr_t uptr);
static int aac_get_pci_info(struct aac_softc *sc, caddr_t uptr);
+static int aac_supported_features(struct aac_softc *sc, caddr_t uptr);
static void aac_ioctl_event(struct aac_softc *sc,
struct aac_event *event, void *arg);
static struct aac_mntinforesp *
@@ -2979,6 +2980,12 @@ aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
fwprintf(sc, HBA_FLAGS_DBG_IOCTL_COMMANDS_B, "FSACTL_GET_PCI_INFO");
error = aac_get_pci_info(sc, arg);
break;
+ case FSACTL_GET_FEATURES:
+ arg = *(caddr_t*)arg;
+ case FSACTL_LNX_GET_FEATURES:
+ fwprintf(sc, HBA_FLAGS_DBG_IOCTL_COMMANDS_B, "FSACTL_GET_FEATURES");
+ error = aac_supported_features(sc, arg);
+ break;
default:
fwprintf(sc, HBA_FLAGS_DBG_IOCTL_COMMANDS_B, "unsupported cmd 0x%lx\n", cmd);
error = EINVAL;
@@ -3479,6 +3486,43 @@ aac_get_pci_info(struct aac_softc *sc, caddr_t uptr)
return (error);
}
+static int
+aac_supported_features(struct aac_softc *sc, caddr_t uptr)
+{
+ struct aac_features f;
+ int error;
+
+ fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
+
+ if ((error = copyin(uptr, &f, sizeof (f))) != 0)
+ return (error);
+
+ /*
+ * When the management driver receives FSACTL_GET_FEATURES ioctl with
+ * ALL zero in the featuresState, the driver will return the current
+ * state of all the supported features, the data field will not be
+ * valid.
+ * When the management driver receives FSACTL_GET_FEATURES ioctl with
+ * a specific bit set in the featuresState, the driver will return the
+ * current state of this specific feature and whatever data that are
+ * associated with the feature in the data field or perform whatever
+ * action needed indicates in the data field.
+ */
+ if (f.feat.fValue == 0) {
+ f.feat.fBits.largeLBA =
+ (sc->flags & AAC_FLAGS_LBA_64BIT) ? 1 : 0;
+ /* TODO: In the future, add other features state here as well */
+ } else {
+ if (f.feat.fBits.largeLBA)
+ f.feat.fBits.largeLBA =
+ (sc->flags & AAC_FLAGS_LBA_64BIT) ? 1 : 0;
+ /* TODO: Add other features state and data in the future */
+ }
+
+ error = copyout(&f, uptr, sizeof (f));
+ return (error);
+}
+
/*
* Give the userland some information about the container. The AAC arch
* expects the driver to be a SCSI passthrough type driver, so it expects