diff options
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 568c0d22f0f..3c13eebd4d1 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.122 2008/11/23 22:06:43 deraadt Exp $ */ +/* $OpenBSD: softraid.c,v 1.123 2008/11/23 23:44:01 tedu Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -37,6 +37,12 @@ #include <sys/stat.h> #include <sys/conf.h> #include <sys/uio.h> +#include <sys/workq.h> + +#ifdef AOE +#include <sys/mbuf.h> +#include <net/if_aoe.h> +#endif /* AOE */ #include <crypto/cryptodev.h> @@ -1815,6 +1821,22 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) strlcpy(sd->sd_name, "RAID 1", sizeof(sd->sd_name)); vol_size = ch_entry->src_meta.scmi.scm_coerced_size; break; +#ifdef AOE +#ifdef notyet + case 'A': + /* target */ + if (no_chunk != 1) + goto unwind; + strlcpy(sd->sd_name, "AOE TARGET", sizeof(sd->sd_name)); + break; +#endif /* notyet */ + case 'a': + /* initiator */ + if (no_chunk != 1) + goto unwind; + strlcpy(sd->sd_name, "AOE INITIATOR", sizeof(sd->sd_name)); + break; +#endif /* AOE */ #ifdef CRYPTO case 'C': DNPRINTF(SR_D_IOCTL, @@ -1970,6 +1992,49 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) sd->sd_set_chunk_state = sr_raid1_set_chunk_state; sd->sd_set_vol_state = sr_raid1_set_vol_state; break; +#ifdef AOE +#ifdef notyet + case 'A': + /* fill out discipline members */ + sd->sd_type = SR_MD_AOE; + sd->sd_max_ccb_per_wu = no_chunk; + sd->sd_max_wu = SR_RAIDAOE_NOWU; + + /* setup discipline pointers */ + sd->sd_alloc_resources = sr_aoe_start_server; + sd->sd_free_resources = sr_aoe_free_resources; + sd->sd_scsi_inquiry = sr_raid_inquiry; + sd->sd_scsi_read_cap = sr_raid_read_cap; + sd->sd_scsi_tur = sr_raid_tur; + sd->sd_scsi_req_sense = sr_raid_request_sense; + sd->sd_scsi_start_stop = sr_raid_start_stop; + sd->sd_scsi_sync = sr_raid_sync; + sd->sd_scsi_rw = sr_aoe_rw; + sd->sd_set_chunk_state = sr_raid_set_chunk_state; + sd->sd_set_vol_state = sr_raid_set_vol_state; + break; +#endif /* notyet */ + case 'a': + /* fill out discipline members */ + sd->sd_type = SR_MD_AOE; + sd->sd_max_ccb_per_wu = no_chunk; + sd->sd_max_wu = SR_RAIDAOE_NOWU; + + /* setup discipline pointers */ + sd->sd_alloc_resources = sr_aoe_alloc_resources; + sd->sd_free_resources = sr_aoe_free_resources; + sd->sd_scsi_inquiry = sr_raid_inquiry; + sd->sd_scsi_read_cap = sr_raid_read_cap; + sd->sd_scsi_tur = sr_raid_tur; + sd->sd_scsi_req_sense = sr_raid_request_sense; + sd->sd_scsi_start_stop = sr_raid_start_stop; + sd->sd_scsi_sync = sr_raid_sync; + sd->sd_scsi_rw = sr_aoe_rw; + /* XXX reuse raid 1 functions for now FIXME */ + sd->sd_set_chunk_state = sr_raid1_set_chunk_state; + sd->sd_set_vol_state = sr_raid1_set_vol_state; + break; +#endif #ifdef CRYPTO case 'C': /* fill out discipline members */ |