summaryrefslogtreecommitdiffstats
path: root/sys/dev/twe/twevar.h
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2003-08-12 06:38:55 +0000
committerps <ps@FreeBSD.org>2003-08-12 06:38:55 +0000
commit1bff6686ac1f910b42d321c4b6aeed66c70f7a4d (patch)
treeef44b15d650aa36cef07ac360c95a3df64d9c9e3 /sys/dev/twe/twevar.h
parent1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b (diff)
downloadFreeBSD-src-1bff6686ac1f910b42d321c4b6aeed66c70f7a4d.zip
FreeBSD-src-1bff6686ac1f910b42d321c4b6aeed66c70f7a4d.tar.gz
Fix the busdma support in twe to support EINPROGRESS and enable it for
use with PAE kernels.
Diffstat (limited to 'sys/dev/twe/twevar.h')
-rw-r--r--sys/dev/twe/twevar.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/twe/twevar.h b/sys/dev/twe/twevar.h
index d28bd35..22fb966 100644
--- a/sys/dev/twe/twevar.h
+++ b/sys/dev/twe/twevar.h
@@ -70,9 +70,7 @@ struct twe_drive
*/
struct twe_request
{
- /* controller command */
- TWE_Command tr_command; /* command as submitted to controller */
-
+ int tr_tag;
/* command payload */
void *tr_data; /* data buffer */
void *tr_realdata; /* copy of real data buffer pointer for alignment fixup */
@@ -89,12 +87,20 @@ struct twe_request
#define TWE_CMD_DATAOUT (1<<1)
#define TWE_CMD_ALIGNBUF (1<<2) /* data in bio is misaligned, have to copy to/from private buffer */
#define TWE_CMD_SLEEPER (1<<3) /* owner is sleeping on this command */
+#define TWE_CMD_IMMEDIATE (1<<4) /* immediate request */
+#define TWE_CMD_MAPPED (1<<5)
void (* tr_complete)(struct twe_request *tr); /* completion handler */
void *tr_private; /* submitter-private data or wait channel */
TWE_PLATFORM_REQUEST /* platform-specific request elements */
};
+#define TWE_FIND_COMMAND(tr) \
+ (TWE_Command *)((u_int8_t *)(tr)->tr_sc->twe_cmd + \
+ ((tr)->tr_tag * sizeof(TWE_Command)))
+#define TWE_FIND_COMMANDPHYS(tr) ((tr)->tr_sc->twe_cmdphys + \
+ ((tr)->tr_tag * sizeof(TWE_Command)))
+
/*
* Per-controller state.
*/
@@ -120,6 +126,7 @@ struct twe_softc
#define TWE_STATE_SHUTDOWN (1<<1) /* controller is shut down */
#define TWE_STATE_OPEN (1<<2) /* control device is open */
#define TWE_STATE_SUSPEND (1<<3) /* controller is suspended */
+#define TWE_STATE_FRZN (1<<4)
int twe_host_id;
struct twe_qstat twe_qstat[TWEQ_COUNT]; /* queue statistics */
@@ -134,6 +141,7 @@ extern void twe_init(struct twe_softc *sc); /* init controller */
extern void twe_deinit(struct twe_softc *sc); /* stop controller */
extern void twe_intr(struct twe_softc *sc); /* hardware interrupt signalled */
extern void twe_startio(struct twe_softc *sc);
+extern int twe_start(struct twe_request *tr);
extern int twe_dump_blocks(struct twe_softc *sc, int unit, /* crashdump block write */
u_int32_t lba, void *data, int nblks);
extern int twe_ioctl(struct twe_softc *sc, int cmd,
@@ -144,15 +152,15 @@ extern void twe_enable_interrupts(struct twe_softc *sc); /* enable controller in
extern void twe_disable_interrupts(struct twe_softc *sc); /* disable controller interrupts */
extern void twe_attach_drive(struct twe_softc *sc,
- struct twe_drive *dr); /* attach drive when found in twe_add_unit */
+ struct twe_drive *dr); /* attach drive when found in twe_init */
extern void twe_detach_drive(struct twe_softc *sc,
int unit); /* detach drive */
extern void twe_clear_pci_parity_error(struct twe_softc *sc);
extern void twe_clear_pci_abort(struct twe_softc *sc);
extern void twed_intr(twe_bio *bp); /* return bio from core */
-extern struct twe_request *twe_allocate_request(struct twe_softc *sc); /* allocate request structure */
+extern struct twe_request *twe_allocate_request(struct twe_softc *sc, int tag); /* allocate request structure */
extern void twe_free_request(struct twe_request *tr); /* free request structure */
-extern void twe_map_request(struct twe_request *tr); /* make request visible to controller, do s/g */
+extern int twe_map_request(struct twe_request *tr); /* make request visible to controller, do s/g */
extern void twe_unmap_request(struct twe_request *tr); /* cleanup after transfer, unmap */
/********************************************************************************
@@ -232,7 +240,6 @@ TWEQ_REQUEST_QUEUE(ready, TWEQ_READY)
TWEQ_REQUEST_QUEUE(busy, TWEQ_BUSY)
TWEQ_REQUEST_QUEUE(complete, TWEQ_COMPLETE)
-
/*
* outstanding bio queue
*/
OpenPOWER on IntegriCloud