struct scb *scb;
struct ahd_initiator_tinfo *targ_info;
struct ahd_tmode_tstate *tstate;
- struct ahd_transinfo *tinfo;
u_int scbid;
/*
devinfo.our_scsiid,
devinfo.target,
&tstate);
- tinfo = &targ_info->curr;
ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
AHD_TRANS_ACTIVE, /*paused*/TRUE);
ahd_set_syncrate(ahd, &devinfo, /*period*/0,
sg_list = (struct ahd_dma64_seg*)scb->sg_list;
for (i = 0; i < scb->sg_count; i++) {
uint64_t addr;
- uint32_t len;
addr = aic_le64toh(sg_list[i].addr);
- len = aic_le32toh(sg_list[i].len);
kprintf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
i,
(uint32_t)((addr >> 32) & 0xFFFFFFFF),
* $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic_osm_lib.c#5 $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.c,v 1.3 2004/08/17 00:14:31 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic_osm_lib.c,v 1.3 2008/02/09 18:13:13 pavalos Exp $
*/
static void aic_recovery_thread(void *arg);
* them after we've successfully fixed this problem.
*/
LIST_FOREACH(list_scb, &aic->pending_scbs, pending_links) {
- union ccb *ccb;
-
- ccb = list_scb->io_ctx;
callout_stop(&scb->io_timer);
}
}
amd_action(struct cam_sim * psim, union ccb * pccb)
{
struct amd_softc * amd;
- u_int target_id, target_lun;
+ u_int target_id;
CAM_DEBUG(pccb->ccb_h.path, CAM_DEBUG_TRACE, ("amd_action\n"));
amd = (struct amd_softc *) cam_sim_softc(psim);
target_id = pccb->ccb_h.target_id;
- target_lun = pccb->ccb_h.target_lun;
switch (pccb->ccb_h.func_code) {
case XPT_SCSI_IO:
static int
amdparsemsg(struct amd_softc *amd)
{
- struct amd_target_info *targ_info;
int reject;
int done;
int response;
response = FALSE;
reject = FALSE;
- targ_info = &amd->tinfo[amd->cur_target];
-
/*
* Parse as much of the message as is availible,
* rejecting it if we don't support it. When
struct ccb_scsiio *pcsio;
struct amd_sg *ptr2;
u_int32_t swlval;
- u_int target_id, target_lun;
pccb = pSRB->pccb;
pcsio = &pccb->csio;
- target_id = pSRB->pccb->ccb_h.target_id;
- target_lun = pSRB->pccb->ccb_h.target_lun;
CAM_DEBUG(pccb->ccb_h.path, CAM_DEBUG_TRACE,
("SRBdone - TagNumber %d\n", pSRB->TagNumber));
fcparam *fcp;
uint8_t *scp;
uint32_t sst, parm1;
- int rval, lev;
+ int rval;
const char *msg;
char buf[64];
parm1 = plp->plogx_ioparm[1].lo16 | (plp->plogx_ioparm[1].hi16 << 16);
rval = -1;
- lev = ISP_LOGERR;
msg = NULL;
switch (sst) {
msg = buf;
break;
case PLOGX_IOCBERR_PORTUSED:
- lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1);
msg = buf;
rval = MBOX_PORT_ID_USED | (parm1 << 16);
break;
case PLOGX_IOCBERR_HNDLUSED:
- lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1);
msg = buf;
rval = MBOX_LOOP_ID_USED;
{
union ccb *ccb;
tcb_p tp;
- lcb_p lp;
/*
** Sanity check
ccb = cp->ccb;
cp->ccb = NULL;
tp = &np->target[ccb->ccb_h.target_id];
- lp = tp->lp[ccb->ccb_h.target_lun];
/*
** We do not queue more than 1 nccb per target
struct amr_linux_ioctl ali;
void *dp, *temp;
int error;
- int adapter, len, ac_flags = 0;
+ int len, ac_flags = 0;
int logical_drives_changed = 0;
u_int32_t linux_version = 0x02100000;
u_int8_t status;
else
len = ali.ui.fcs.length;
- adapter = (ali.ui.fcs.adapno) ^ 'm' << 8;
-
mb = (void *)&ali.mbox[0];
if ((ali.mbox[0] == FC_DEL_LOGDRV && ali.mbox[2] == OP_DEL_LOGDRV) || /* delete */
void *dp, *au_buffer;
unsigned long au_length, real_length;
unsigned char *au_cmd;
- int *au_statusp, au_direction;
+ int *au_statusp;
int error;
struct amr_passthrough *_ap; /* 60 bytes */
int logical_drives_changed = 0;
au_cmd = arg.au32->au_cmd;
au_buffer = (void *)(u_int64_t)arg.au32->au_buffer;
au_length = arg.au32->au_length;
- au_direction = arg.au32->au_direction;
au_statusp = &arg.au32->au_status;
break;
#endif
au_cmd = arg.au->au_cmd;
au_buffer = (void *)arg.au->au_buffer;
au_length = arg.au->au_length;
- au_direction = arg.au->au_direction;
au_statusp = &arg.au->au_status;
break;
struct ciss_lun_report *cll;
int error = 0, i;
int nphys;
- int bus, target;
+ int bus;
debug_called(1);
bus = 0;
- target = 0;
cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS,
CISS_MAX_PHYSICAL);
static void
ciss_release_request(struct ciss_request *cr)
{
- struct ciss_softc *sc;
-
debug_called(2);
- sc = cr->cr_sc;
-
/* release the request to the free queue */
ciss_requeue_free(cr);
}
ciss_cam_emulate(struct ciss_softc *sc, struct ccb_scsiio *csio)
{
int bus, target;
- u_int8_t opcode;
target = csio->ccb_h.target_id;
bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path));
- opcode = (csio->ccb_h.flags & CAM_CDB_POINTER) ?
- *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0];
if (CISS_IS_PHYSICAL(bus)) {
if (sc->ciss_physical[CISS_CAM_TO_PBUS(bus)][target].cp_online != 1) {
static void
ciss_notify_complete(struct ciss_request *cr)
{
- struct ciss_command *cc;
struct ciss_notify *cn;
struct ciss_softc *sc;
int scsi_status;
int command_status;
debug_called(1);
- cc = cr->cr_cc;
cn = (struct ciss_notify *)cr->cr_data;
sc = cr->cr_sc;
union mfi_sgl *sgl;
struct mfi_softc *sc;
int i, j, first, dir;
- int sge_size;
cm = (struct mfi_command *)arg;
sc = cm->cm_sc;
sgl->sg_skinny[i].flag = 0;
}
hdr->flags |= MFI_FRAME_IEEE_SGL | MFI_FRAME_SGL64;
- sge_size = sizeof(struct mfi_sg_skinny);
hdr->sg_count = nsegs;
} else {
j = 0;
hdr->flags |= MFI_FRAME_SGL64;
}
hdr->sg_count = j;
- sge_size = sc->mfi_sge_size;
}
dir = 0;
int i, res;
struct mfi_ioc_passthru *iop = (struct mfi_ioc_passthru *)arg;
int error, locked;
- union mfi_sgl *sgl;
sc = dev->si_drv1;
error = 0;
cm->cm_sg =
(union mfi_sgl *)&cm->cm_frame->bytes[ioc->mfi_sgl_off];
}
- sgl = cm->cm_sg;
cm->cm_flags = 0;
if (cm->cm_frame->header.flags & MFI_FRAME_DATAIN)
cm->cm_flags |= MFI_CMD_DATAIN;
int
mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd)
{
- uint32_t device_id;
uint32_t sge_count;
uint8_t cdb[32], cdb_len;
memset(cdb, 0, 32);
struct mfi_mpi2_request_raid_scsi_io *io_request = cmd->io_request;
- device_id = mfi_cmd->cm_frame->header.target_id;
-
/* Have to build CDB here for TB as BSD don't have a scsi layer */
if ((cdb_len = mfi_tbolt_build_cdb(sc, mfi_cmd, cdb)) == 1)
return 1;
mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
pMpi25IeeeSgeChain64_t sgl_ptr, struct mfi_cmd_tbolt *cmd)
{
- uint8_t i, sg_processed, sg_to_process;
+ uint8_t i, sg_processed;
uint8_t sge_count, sge_idx;
union mfi_sgl *os_sgl;
if (sg_processed < sge_count) {
pMpi25IeeeSgeChain64_t sg_chain;
- sg_to_process = sge_count - sg_processed;
cmd->io_request->ChainOffset =
sc->chain_offset_value_for_main_message;
sg_chain = sgl_ptr;
static int
tws_setup_irq(struct tws_softc *sc)
{
- int messages;
u_int16_t cmd;
cmd = pci_read_config(sc->tws_dev, PCIR_COMMAND, 2);
return(FAILURE);
device_printf(sc->tws_dev, "Using MSI\n");
#else
- messages = 0;
panic("%s: Using MSI", device_get_nameunit(sc->tws_dev));
#endif
break;
enum sdstate state = sd_unallocated; /* state to set, if specified */
int autosize = 0; /* set if we autosize in give_sd_to_drive */
int namedsdno; /* index of another with this name */
- char partition = 0; /* partition of external subdisk */
sdno = get_empty_sd(); /* allocate an SD to initialize */
sd = &SD[sdno]; /* and get a pointer */
"%s: invalid partition %c",
sd->name,
token[parameter][0]);
- else
- partition = token[parameter][0];
break;
case kw_retryerrors:
{
struct nlookupdata nd;
int error;
- const char *dname;
/*
* Fail if already open
*/
if (drive->flags & VF_OPEN)
return EBUSY;
- dname = drive->devicename;
if (rootdev) {
/*
daemon_save_config(void)
{
int error;
- int written_config; /* set when we first write the config to disk */
int driveno;
struct drive *drive; /* point to current drive info */
struct vinum_hdr *vhdr; /* and as header */
/* don't save the configuration while we're still working on it */
if (vinum_conf.flags & VF_CONFIGURING)
return;
- written_config = 0; /* no config written yet */
/* Build a volume header */
vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* get space for the config data */
CHECKALLOC(vhdr, "Can't allocate config data");
drive->devicename,
error);
set_drive_state(drive->driveno, drive_down, setstate_force);
- } else
- written_config = 1; /* we've written it on at least one drive */
+ }
}
} else /* not worth looking at, */
unlockdrive(drive); /* just unlock it again */
{
struct drive *volatile drive;
volatile int driveno;
- int firstdrive; /* first drive in this list */
volatile int gooddrives; /* number of usable drives found */
int firsttime; /* set if we have never configured before */
int error;
vinum_conf.flags |= VF_READING_CONFIG; /* reading config from disk */
gooddrives = 0; /* number of usable drives found */
- firstdrive = vinum_conf.drives_used; /* the first drive */
firsttime = vinum_conf.drives_used == 0; /* are we a virgin? */
/* allocate a drive pointer list */
{
struct buf *bp = bio->bio_buf;
int plexno;
- int maxplex; /* maximum number of plexes to handle */
struct volume *vol;
struct request *rq; /* build up our request here */
enum requeststatus status;
rq->volplex.volno = Volno(dev); /* get the volume number */
vol = &VOL[rq->volplex.volno]; /* and point to it */
vol->active++; /* one more active request */
- maxplex = vol->plexes; /* consider all its plexes */
} else {
vol = NULL; /* no volume */
rq->volplex.plexno = Plexno(dev); /* point to the plex */
rq->isplex = 1; /* note that it's a plex */
- maxplex = 1; /* just the one plex */
}
if (bp->b_cmd == BUF_CMD_READ) {
vinum_off_t diskaddr; /* offset of current part of transfer */
vinum_off_t diskend; /* and end offset of transfer */
int plexno; /* plex index in vinum_conf */
- struct rqgroup *rqg; /* point to the request we're working on */
struct volume *vol; /* volume in question */
int recovered = 0; /* set if we recover a read */
enum requeststatus status = REQUEST_OK;
bp = bio->bio_buf;
diskaddr = bio->bio_offset >> DEV_BSHIFT; /* start offset of transfer */
diskend = diskaddr + (bp->b_bcount / DEV_BSIZE); /* and end offset of transfer */
- rqg = &rq->rqg[plexindex]; /* plex request */
vol = &VOL[rq->volplex.volno]; /* point to volume */
while (diskaddr < diskend) { /* build up request components */
build_rq_buffer(struct rqelement *rqe, struct plex *plex)
{
struct sd *sd; /* point to subdisk */
- struct volume *vol;
struct buf *bp;
struct buf *ubp; /* user (high level) buffer header */
struct bio *ubio;
- vol = &VOL[rqe->rqg->rq->volplex.volno];
sd = &SD[rqe->sdno]; /* point to subdisk */
bp = &rqe->b;
ubio = rqe->rqg->rq->bio; /* pointer to user buffer header */
int plexno;
struct plex *plex;
int size; /* I/O transfer size, bytes */
- vinum_off_t stripe; /* stripe number in plex */
- int psd; /* parity subdisk number */
struct rangelock *lock; /* lock on stripe */
struct _ioctl_reply *reply;
off_t pstripe; /* pointer to our stripe counter */
return;
}
pstripe = data->offset;
- stripe = pstripe / plex->stripesize; /* stripe number */
- psd = plex->subdisks - 1 - stripe % plex->subdisks; /* parity subdisk for this stripe */
size = imin(DEFAULT_REVIVE_BLOCKSIZE, /* one block at a time */
plex->stripesize << DEV_BSHIFT);
{
struct sd *sd;
struct plex *plex;
- struct volume *vol;
struct buf *bp;
int error;
int size; /* size of init block, bytes */
- vinum_off_t plexblkno; /* lblkno in plex */
int verified; /* set when we're happy with what we wrote */
error = 0;
- plexblkno = 0; /* to keep the compiler happy */
sd = &SD[sdno];
if (sd->plexno < 0) /* no plex? */
return EINVAL;
plex = &PLEX[sd->plexno]; /* point to plex */
- if (plex->volno >= 0)
- vol = &VOL[plex->volno];
- else
- vol = NULL;
if (sd->init_blocksize == 0) {
if (plex->stripesize != 0) /* we're striped, don't init more than */