start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
} else {
struct ccb_getdev *cgd;
- struct cam_eb *bus;
- struct cam_et *tar;
cgd = &start_ccb->cgd;
- bus = cgd->ccb_h.path->bus;
- tar = cgd->ccb_h.path->target;
cgd->inq_data = dev->inq_data;
cgd->ccb_h.status = CAM_REQ_CMP;
cgd->serial_num_len = dev->serial_num_len;
if (ccb_h->flags & CAM_HIGH_POWER) {
struct highpowerlist *hphead;
- struct cam_ed *device;
union ccb *send_ccb;
lockmgr(&xsoftc.xpt_lock, LK_EXCLUSIVE);
* Any high powered commands queued up?
*/
if (send_ccb != NULL) {
- device = send_ccb->ccb_h.path->device;
-
STAILQ_REMOVE_HEAD(hphead, xpt_links.stqe);
lockmgr(&xsoftc.xpt_lock, LK_RELEASE);
cdev_t dev = ap->a_head.a_dev;
struct cam_periph *periph;
struct ch_softc *softc;
- int unit, error;
-
- error = 0;
+ int unit;
unit = CHUNIT(dev);
periph = cam_extend_get(chperiphs, unit);
struct buf *bp;
struct cam_periph *periph;
int byte_count;
- struct da_softc * softc;
off_t *del_num = (off_t*)ap->a_data;
off_t bytes_left;
periph = cam_extend_get(daperiphs, unit);
if (periph == NULL)
return(ENXIO);
- softc = (struct da_softc *)periph->softc;
switch (ap->a_cmd) {
case IOCTLTRIM:
struct cam_periph *periph;
struct da_softc *softc;
u_int unit;
- u_int part;
unit = dkunit(dev);
- part = dkpart(dev);
periph = cam_extend_get(daperiphs, unit);
if (periph == NULL) {
bp->b_error = ENXIO;
case AC_FOUND_DEVICE:
{
struct ccb_getdev *cgd;
- struct cam_sim *sim;
cam_status status;
cgd = (struct ccb_getdev *)arg;
* this device and start the probe
* process.
*/
- sim = xpt_path_sim(cgd->ccb_h.path);
status = cam_periph_alloc(daregister, daoninvalidate,
dacleanup, dastart,
"da", CAM_PERIPH_BIO,
scsi_low_abort_ccb(struct scsi_low_softc *slp, struct slccb *cb)
{
struct targ_info *ti;
- struct lun_info *li;
u_int msg;
if (cb == NULL)
return EBUSY;
ti = cb->ti;
- li = cb->li;
if (cb->ccb_tag == SCSI_LOW_UNKTAG)
msg = SCSI_LOW_MSG_ABORT;
else
struct cam_path *path, void *arg)
{
struct cam_periph *periph;
- struct cam_sim *sim;
periph = (struct cam_periph *)callback_arg;
* this device and start the probe
* process.
*/
- sim = xpt_path_sim(cgd->ccb_h.path);
status = cam_periph_alloc(passregister, passoninvalidate,
passcleanup, passstart, "pass",
CAM_PERIPH_BIO, cgd->ccb_h.path,
static void
passdone(struct cam_periph *periph, union ccb *done_ccb)
{
- struct pass_softc *softc;
struct ccb_scsiio *csio;
- softc = (struct pass_softc *)periph->softc;
csio = &done_ccb->csio;
switch (csio->ccb_h.ccb_type) {
case PASS_CCB_WAITING:
cdev_t dev = ap->a_head.a_dev;
caddr_t addr = ap->a_data;
struct cam_periph *periph;
- struct pass_softc *softc;
u_int8_t unit;
int error;
return(ENXIO);
cam_periph_lock(periph);
- softc = (struct pass_softc *)periph->softc;
error = 0;
cdev_t dev = ap->a_head.a_dev;
struct cam_periph *periph;
struct ses_softc *softc;
- int unit, error;
-
- error = 0;
+ int unit;
unit = SESUNIT(dev);
periph = cam_extend_get(sesperiphs, unit);
case SG_CCB_RDWR_IO:
{
struct sg_rdwr *rdwr;
- int state;
devstat_end_transaction(
&softc->device_stats,
DEVSTAT_WRITE : DEVSTAT_READ));
rdwr = done_ccb->ccb_h.ccb_rdwr;
- state = rdwr->state;
rdwr->state = SG_RDWR_DONE;
wakeup(rdwr);
break;
targdone(struct cam_periph *periph, union ccb *done_ccb)
{
struct targ_softc *softc;
- cam_status status;
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("targdone %p\n", done_ccb));
softc = (struct targ_softc *)periph->softc;
TAILQ_REMOVE(&softc->pending_ccb_queue, &done_ccb->ccb_h,
periph_links.tqe);
- status = done_ccb->ccb_h.status & CAM_STATUS_MASK;
/* If we're no longer enabled, throw away CCB */
if ((softc->state & TARG_STATE_LUN_ENABLED) == 0) {
static int
firewire_attach(device_t dev)
{
- int unit;
struct firewire_softc *sc = device_get_softc(dev);
device_t pa = device_get_parent(dev);
struct firewire_comm *fc;
sc->fc = fc;
fc->status = FWBUSNOTREADY;
- unit = device_get_unit(dev);
if( fc->nisodma > FWMAXNDMA) fc->nisodma = FWMAXNDMA;
fwdev_makedev(sc);
int unit = DEV2UNIT(dev);
int slept = 0;
struct fw_pkt *fp;
- struct firewire_comm *fc;
struct fw_xferq *it;
if (DEV_FWMEM(dev))
return physwrite(ap);
sc = devclass_get_softc(firewire_devclass, unit);
- fc = sc->fc;
it = ((struct fw_drv1 *)dev->si_drv1)->it;
if (it == NULL || it->buf == NULL)
return (EIO);
fw_kqfilter(struct dev_kqfilter_args *ap)
{
cdev_t dev = ap->a_head.a_dev;
- struct firewire_softc *sc;
struct fw_xferq *ir;
struct knote *kn = ap->a_kn;
- int unit = DEV2UNIT(dev);
struct klist *klist;
/*
return (0);
}
- sc = devclass_get_softc(firewire_devclass, unit);
ir = ((struct fw_drv1 *)dev->si_drv1)->ir;
ap->a_result = 0;
fw_mmap (struct dev_mmap_args *ap)
{
cdev_t dev = ap->a_head.a_dev;
- struct firewire_softc *sc;
- int unit = DEV2UNIT(dev);
if (DEV_FWMEM(dev))
return fwmem_mmap(ap);
- sc = devclass_get_softc(firewire_devclass, unit);
return EINVAL;
}
int
fwdev_makedev(struct firewire_softc *sc)
{
- int unit;
-
- unit = device_get_unit(sc->fc->bdev);
/*HELPME dev_ops_add(&firewire_ops, FW_UNITMASK, FW_UNIT(unit));*/
return(0);
}
void
fwohci_timeout(void *arg)
{
- struct fwohci_softc *sc;
-
- sc = (struct fwohci_softc *)arg;
}
u_int32_t
{
struct fwohci_softc *sc = (struct fwohci_softc *)fc;
int err = 0;
- unsigned short tag, ich;
struct fwohci_dbch *dbch;
int cycle_match, cycle_now, ldesc;
u_int32_t stat;
dbch = &sc->it[dmach];
it = &dbch->xferq;
- tag = (it->flag >> 6) & 3;
- ich = it->flag & 0x3f;
if ((dbch->flags & FWOHCI_DBCH_INIT) == 0) {
dbch->ndb = it->bnpacket * it->bnchunk;
dbch->ndesc = 3;
{
struct fwohci_dbch *dbch;
struct fwohcidb_tr *cp = NULL, *pp, *np = NULL;
- struct fwohcidb *curr = NULL, *prev, *next = NULL;
+ struct fwohcidb *curr = NULL;
+#if 0
+ struct fwohcidb *prev, *next = NULL;
+#endif
int idb, jdb;
u_int32_t cmd, off;
if(ch == 0){
return;
}
pp = dbch->top;
+#if 0
prev = pp->db;
+#endif
for(idb = 0 ; idb < dbch->ndb ; idb ++ ){
if(pp == NULL){
curr = NULL;
for(jdb = 0 ; jdb < dbch->ndesc ; jdb ++ ){
if ((cmd & 0xfffffff0) == cp->bus_addr) {
curr = cp->db;
+#if 0
if(np != NULL){
next = np->db;
}else{
next = NULL;
}
+#endif
goto outdb;
}
}
pp = STAILQ_NEXT(pp, link);
+#if 0
prev = pp->db;
+#endif
}
outdb:
if( curr != NULL){
void
fwohci_txbufdb(struct fwohci_softc *sc, int dmach, struct fw_bulkxfer *bulkxfer)
{
- struct fwohcidb_tr *db_tr, *fdb_tr;
+ struct fwohcidb_tr *db_tr;
+#if 0
+ struct fwohcidb_tr *fdb_tr;
+#endif
struct fwohci_dbch *dbch;
struct fwohcidb *db;
struct fw_pkt *fp;
chtag = sc->it[dmach].xferq.flag & 0xff;
db_tr = (struct fwohcidb_tr *)(bulkxfer->start);
+#if 0
fdb_tr = (struct fwohcidb_tr *)(bulkxfer->end);
-/*
-device_printf(sc->fc.dev, "DB %08x %08x %08x\n", bulkxfer, db_tr->bus_addr, fdb_tr->bus_addr);
-*/
+ device_printf(sc->fc.dev, "DB %08x %08x %08x\n", bulkxfer,
+ db_tr->bus_addr, fdb_tr->bus_addr);
+#endif
for (idb = 0; idb < dbch->xferq.bnpacket; idb ++) {
db = db_tr->db;
fp = (struct fw_pkt *)db_tr->buf;
{
struct fw_pkt *fp0;
u_int32_t ld0;
- int slen, hlen;
+ int hlen;
#if BYTE_ORDER == BIG_ENDIAN
- int i;
+ int slen, i;
#endif
ld0 = FWOHCI_DMA_READ(fp->mode.ld[0]);
case FWTCODE_WREQQ:
case FWTCODE_RRESQ:
case FWOHCITCODE_PHY:
+#if BYTE_ORDER == BIG_ENDIAN
slen = 12;
break;
+#endif
case FWTCODE_RREQB:
case FWTCODE_WREQB:
case FWTCODE_LREQ:
case FWTCODE_RRESB:
case FWTCODE_LRES:
+#if BYTE_ORDER == BIG_ENDIAN
slen = 16;
break;
+#endif
default:
kprintf("Unknown tcode %d\n", fp0->mode.common.tcode);
return(0);
int nvec;
struct fw_pkt *fp;
u_int8_t *ld;
- u_int32_t stat, off, status;
+ u_int32_t stat, status;
u_int spd;
int len, plen, hlen, pcnt, offset;
caddr_t buf;
int resCount;
- if(&sc->arrq == dbch){
- off = OHCI_ARQOFF;
- }else if(&sc->arrs == dbch){
- off = OHCI_ARSOFF;
- }else{
+ if (&sc->arrq != dbch && &sc->arrs != dbch)
return;
- }
crit_enter();
db_tr = dbch->top;
struct pci_devinfo *dinfo = device_get_ivars(child);
pcicfgregs *cfg = &dinfo->cfg;
uint16_t status;
- int result, oldstate, highest, delay;
+ int oldstate, highest, delay;
if (cfg->pp.pp_cap == 0)
return (EOPNOTSUPP);
delay = 0;
status = PCI_READ_CONFIG(dev, child, cfg->pp.pp_status, 2)
& ~PCIM_PSTAT_DMASK;
- result = 0;
switch (state) {
case PCI_POWERSTATE_D0:
status |= PCIM_PSTAT_D0;