Lines Matching refs:psc
67 struct pst_softc *psc; /* pointer to softc */ member
90 struct pst_softc *psc; in pst_add_raid() local
95 if (!(psc = malloc(sizeof(struct pst_softc), in pst_add_raid()
100 psc->iop = sc; in pst_add_raid()
101 psc->lct = lct; in pst_add_raid()
102 device_set_softc(child, psc); in pst_add_raid()
116 struct pst_softc *psc = device_get_softc(dev); in pst_attach() local
122 if (!(reply = iop_get_util_params(psc->iop, psc->lct->local_tid, in pst_attach()
127 if (!(psc->info = (struct i2o_bsa_device *) in pst_attach()
132 bcopy(reply->result, psc->info, sizeof(struct i2o_bsa_device)); in pst_attach()
135 if (!(reply = iop_get_util_params(psc->iop, psc->lct->local_tid, in pst_attach()
146 psc->info->capacity, psc->info->block_size); in pst_attach()
153 bioq_init(&psc->queue); in pst_attach()
155 psc->disk = disk_alloc(); in pst_attach()
156 psc->disk->d_name = "pst"; in pst_attach()
157 psc->disk->d_strategy = pststrategy; in pst_attach()
158 psc->disk->d_maxsize = 64 * 1024; /*I2O_SGL_MAX_SEGS * PAGE_SIZE;*/ in pst_attach()
159 psc->disk->d_drv1 = psc; in pst_attach()
160 psc->disk->d_unit = lun; in pst_attach()
162 psc->disk->d_sectorsize = psc->info->block_size; in pst_attach()
163 psc->disk->d_mediasize = psc->info->capacity; in pst_attach()
164 psc->disk->d_fwsectors = 63; in pst_attach()
165 psc->disk->d_fwheads = 255; in pst_attach()
167 disk_create(psc->disk, DISK_VERSION); in pst_attach()
170 (unsigned long long)psc->info->capacity / (1024 * 1024), in pst_attach()
171 name, psc->info->capacity/(512*255*63), 255, 63, in pst_attach()
172 device_get_nameunit(psc->iop->dev)); in pst_attach()
182 struct pst_softc *psc = device_get_softc(dev); in pst_shutdown_post_sync() local
188 psc->iop->reg->oqueue_intr_mask = 0xffffffff; in pst_shutdown_post_sync()
191 mfa = iop_get_mfa(psc->iop); in pst_shutdown_post_sync()
192 msg = (struct i2o_bsa_cache_flush_message *)(psc->iop->ibase + mfa); in pst_shutdown_post_sync()
197 msg->target_address = psc->lct->local_tid; in pst_shutdown_post_sync()
201 if (iop_queue_wait_msg(psc->iop, mfa, (struct i2o_basic_message *)msg)) in pst_shutdown_post_sync()
208 struct pst_softc *psc = bp->bio_disk->d_drv1; in pststrategy() local
210 mtx_lock(&psc->iop->mtx); in pststrategy()
211 bioq_disksort(&psc->queue, bp); in pststrategy()
212 pst_start(psc); in pststrategy()
213 mtx_unlock(&psc->iop->mtx); in pststrategy()
217 pst_start(struct pst_softc *psc) in pst_start() argument
224 if (psc->iop->outstanding < (I2O_IOP_OUTBOUND_FRAME_COUNT - 1) && in pst_start()
225 (bp = bioq_first(&psc->queue))) { in pst_start()
226 if ((mfa = iop_get_mfa(psc->iop)) != 0xffffffff) { in pst_start()
227 bioq_remove(&psc->queue, bp); in pst_start()
232 iop_free_mfa(psc->iop, mfa); in pst_start()
235 callout_init_mtx(&request->timeout, &psc->iop->mtx, 0); in pst_start()
236 psc->iop->outstanding++; in pst_start()
237 request->psc = psc; in pst_start()
242 iop_free_mfa(request->psc->iop, request->mfa); in pst_start()
243 psc->iop->outstanding--; in pst_start()
255 struct pst_softc *psc = request->psc; in pst_done() local
261 psc->iop->reg->oqueue = mfa; in pst_done()
262 psc->iop->outstanding--; in pst_done()
263 pst_start(psc); in pst_done()
273 (request->psc->iop->ibase + request->mfa); in pst_rw()
278 msg->target_address = request->psc->lct->local_tid; in pst_rw()
307 request->psc->iop->reg->iqueue = request->mfa; in pst_rw()
323 mtx_assert(&request->psc->iop->mtx, MA_OWNED); in pst_timeout()
324 iop_free_mfa(request->psc->iop, request->mfa); in pst_timeout()
325 if ((request->mfa = iop_get_mfa(request->psc->iop)) == 0xffffffff) { in pst_timeout()
328 request->psc->iop->outstanding--; in pst_timeout()
332 iop_free_mfa(request->psc->iop, request->mfa); in pst_timeout()
334 request->psc->iop->outstanding--; in pst_timeout()