Lines Matching refs:psc
66 struct pst_softc *psc; /* pointer to softc */ member
89 struct pst_softc *psc; in pst_add_raid() local
94 if (!(psc = malloc(sizeof(struct pst_softc), in pst_add_raid()
99 psc->iop = sc; in pst_add_raid()
100 psc->lct = lct; in pst_add_raid()
101 device_set_softc(child, psc); in pst_add_raid()
115 struct pst_softc *psc = device_get_softc(dev); in pst_attach() local
121 if (!(reply = iop_get_util_params(psc->iop, psc->lct->local_tid, in pst_attach()
126 if (!(psc->info = (struct i2o_bsa_device *) in pst_attach()
131 bcopy(reply->result, psc->info, sizeof(struct i2o_bsa_device)); in pst_attach()
134 if (!(reply = iop_get_util_params(psc->iop, psc->lct->local_tid, in pst_attach()
145 psc->info->capacity, psc->info->block_size); in pst_attach()
152 bioq_init(&psc->queue); in pst_attach()
154 psc->disk = disk_alloc(); in pst_attach()
155 psc->disk->d_name = "pst"; in pst_attach()
156 psc->disk->d_strategy = pststrategy; in pst_attach()
157 psc->disk->d_maxsize = 64 * 1024; /*I2O_SGL_MAX_SEGS * PAGE_SIZE;*/ in pst_attach()
158 psc->disk->d_drv1 = psc; in pst_attach()
159 psc->disk->d_unit = lun; in pst_attach()
161 psc->disk->d_sectorsize = psc->info->block_size; in pst_attach()
162 psc->disk->d_mediasize = psc->info->capacity; in pst_attach()
163 psc->disk->d_fwsectors = 63; in pst_attach()
164 psc->disk->d_fwheads = 255; in pst_attach()
166 disk_create(psc->disk, DISK_VERSION); in pst_attach()
169 (unsigned long long)psc->info->capacity / (1024 * 1024), in pst_attach()
170 name, psc->info->capacity/(512*255*63), 255, 63, in pst_attach()
171 device_get_nameunit(psc->iop->dev)); in pst_attach()
181 struct pst_softc *psc = device_get_softc(dev); in pst_shutdown() local
185 mfa = iop_get_mfa(psc->iop); in pst_shutdown()
186 msg = (struct i2o_bsa_cache_flush_message *)(psc->iop->ibase + mfa); in pst_shutdown()
191 msg->target_address = psc->lct->local_tid; in pst_shutdown()
195 if (iop_queue_wait_msg(psc->iop, mfa, (struct i2o_basic_message *)msg)) in pst_shutdown()
203 struct pst_softc *psc = bp->bio_disk->d_drv1; in pststrategy() local
205 mtx_lock(&psc->iop->mtx); in pststrategy()
206 bioq_disksort(&psc->queue, bp); in pststrategy()
207 pst_start(psc); in pststrategy()
208 mtx_unlock(&psc->iop->mtx); in pststrategy()
212 pst_start(struct pst_softc *psc) in pst_start() argument
219 if (psc->iop->outstanding < (I2O_IOP_OUTBOUND_FRAME_COUNT - 1) && in pst_start()
220 (bp = bioq_first(&psc->queue))) { in pst_start()
221 if ((mfa = iop_get_mfa(psc->iop)) != 0xffffffff) { in pst_start()
222 bioq_remove(&psc->queue, bp); in pst_start()
227 iop_free_mfa(psc->iop, mfa); in pst_start()
230 callout_init_mtx(&request->timeout, &psc->iop->mtx, 0); in pst_start()
231 psc->iop->outstanding++; in pst_start()
232 request->psc = psc; in pst_start()
237 iop_free_mfa(request->psc->iop, request->mfa); in pst_start()
238 psc->iop->outstanding--; in pst_start()
250 struct pst_softc *psc = request->psc; in pst_done() local
256 psc->iop->reg->oqueue = mfa; in pst_done()
257 psc->iop->outstanding--; in pst_done()
258 pst_start(psc); in pst_done()
268 (request->psc->iop->ibase + request->mfa); in pst_rw()
273 msg->target_address = request->psc->lct->local_tid; in pst_rw()
302 request->psc->iop->reg->iqueue = request->mfa; in pst_rw()
318 mtx_assert(&request->psc->iop->mtx, MA_OWNED); in pst_timeout()
319 iop_free_mfa(request->psc->iop, request->mfa); in pst_timeout()
320 if ((request->mfa = iop_get_mfa(request->psc->iop)) == 0xffffffff) { in pst_timeout()
323 request->psc->iop->outstanding--; in pst_timeout()
327 iop_free_mfa(request->psc->iop, request->mfa); in pst_timeout()
329 request->psc->iop->outstanding--; in pst_timeout()