summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-queue.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2012-03-21 08:57:15 +0000
committermarius <marius@FreeBSD.org>2012-03-21 08:57:15 +0000
commit7bb0bdde2aed9f58ebdd5abcb420f0ee56889988 (patch)
tree66c819f0be7ba838256f4040de6ff1668299d3a5 /sys/dev/ata/ata-queue.c
parent2212d818f3c973321979ab28ae07330eb759d324 (diff)
downloadFreeBSD-src-7bb0bdde2aed9f58ebdd5abcb420f0ee56889988.zip
FreeBSD-src-7bb0bdde2aed9f58ebdd5abcb420f0ee56889988.tar.gz
Remove remnants of ATA_LOCKING uses in the ATA_CAM case and wrap it
along with functions, SYSCTLs and tunables that are not used with ATA_CAM in #ifndef ATA_CAM, similar to the existing #ifdef'ed ATA_CAM code for the other way around. This makes it easier to understand which parts of ata(4) actually are used in the new world order and to later on remove the !ATA_CAM bits. It also makes it obvious that there is something fishy with the C-bus front-end as well as in the ATP850 support, as these used ATA_LOCKING which is defunct in the ATA_CAM case. When fixing the former, ATA_LOCKING probably needs to be brought back in some form or other. Reviewed by: mav MFC after: 1 week
Diffstat (limited to 'sys/dev/ata/ata-queue.c')
-rw-r--r--sys/dev/ata/ata-queue.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c
index a58423b..070d711 100644
--- a/sys/dev/ata/ata-queue.c
+++ b/sys/dev/ata/ata-queue.c
@@ -43,11 +43,14 @@ __FBSDID("$FreeBSD$");
#include <dev/ata/ata-all.h>
#include <ata_if.h>
+#ifndef ATA_CAM
/* prototypes */
static void ata_completed(void *, int);
static void ata_sort_queue(struct ata_channel *ch, struct ata_request *request);
-static char *ata_skey2str(u_int8_t);
+static const char *ata_skey2str(u_int8_t);
+#endif
+#ifndef ATA_CAM
void
ata_queue_request(struct ata_request *request)
{
@@ -123,7 +126,9 @@ ata_queue_request(struct ata_request *request)
sema_destroy(&request->done);
}
}
+#endif
+#ifndef ATA_CAM
int
ata_controlcmd(device_t dev, u_int8_t command, u_int16_t feature,
u_int64_t lba, u_int16_t count)
@@ -153,7 +158,9 @@ ata_controlcmd(device_t dev, u_int8_t command, u_int16_t feature,
}
return error;
}
+#endif
+#ifndef ATA_CAM
int
ata_atapicmd(device_t dev, u_int8_t *ccb, caddr_t data,
int count, int flags, int timeout)
@@ -176,7 +183,9 @@ ata_atapicmd(device_t dev, u_int8_t *ccb, caddr_t data,
}
return error;
}
+#endif
+#ifndef ATA_CAM
void
ata_start(device_t dev)
{
@@ -235,7 +244,9 @@ ata_start(device_t dev)
}
}
}
+#endif
+#ifndef ATA_CAM
void
ata_finish(struct ata_request *request)
{
@@ -263,7 +274,9 @@ ata_finish(struct ata_request *request)
}
}
}
+#endif
+#ifndef ATA_CAM
static void
ata_completed(void *context, int dummy)
{
@@ -495,6 +508,7 @@ ata_completed(void *context, int dummy)
if (ch)
ata_start(ch->dev);
}
+#endif
void
ata_timeout(struct ata_request *request)
@@ -520,8 +534,8 @@ ata_timeout(struct ata_request *request)
ata_cam_end_transaction(ch->dev, request);
#endif
mtx_unlock(&ch->state_mtx);
- ATA_LOCKING(ch->dev, ATA_LF_UNLOCK);
#ifndef ATA_CAM
+ ATA_LOCKING(ch->dev, ATA_LF_UNLOCK);
ata_finish(request);
#endif
}
@@ -530,6 +544,7 @@ ata_timeout(struct ata_request *request)
}
}
+#ifndef ATA_CAM
void
ata_fail_requests(device_t dev)
{
@@ -568,7 +583,9 @@ ata_fail_requests(device_t dev)
ata_finish(request);
}
}
+#endif
+#ifndef ATA_CAM
/*
* Rudely drop all requests queued to the channel of specified device.
* XXX: The requests are leaked, use only in fatal case.
@@ -586,7 +603,9 @@ ata_drop_requests(device_t dev)
}
mtx_unlock(&ch->queue_mtx);
}
+#endif
+#ifndef ATA_CAM
static u_int64_t
ata_get_lba(struct ata_request *request)
{
@@ -608,7 +627,9 @@ ata_get_lba(struct ata_request *request)
else
return request->u.ata.lba;
}
+#endif
+#ifndef ATA_CAM
static void
ata_sort_queue(struct ata_channel *ch, struct ata_request *request)
{
@@ -661,6 +682,7 @@ ata_sort_queue(struct ata_channel *ch, struct ata_request *request)
ch->freezepoint = request;
TAILQ_INSERT_AFTER(&ch->ata_queue, this, request, chain);
}
+#endif
char *
ata_cmd2str(struct ata_request *request)
@@ -776,7 +798,8 @@ ata_cmd2str(struct ata_request *request)
return buffer;
}
-static char *
+#ifndef ATA_CAM
+static const char *
ata_skey2str(u_int8_t skey)
{
switch (skey) {
@@ -799,3 +822,4 @@ ata_skey2str(u_int8_t skey)
default: return("UNKNOWN");
}
}
+#endif
OpenPOWER on IntegriCloud