Lines Matching refs:fru
6195 struct bfa_fru_s *fru = cbarg; in bfa_fru_notify() local
6197 bfa_trc(fru, event); in bfa_fru_notify()
6202 if (fru->op_busy) { in bfa_fru_notify()
6203 fru->status = BFA_STATUS_IOC_FAILURE; in bfa_fru_notify()
6204 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_notify()
6205 fru->op_busy = 0; in bfa_fru_notify()
6222 struct bfa_fru_s *fru = cbarg; in bfa_fru_write_send() local
6224 (struct bfi_fru_write_req_s *) fru->mb.msg; in bfa_fru_write_send()
6227 msg->offset = cpu_to_be32(fru->addr_off + fru->offset); in bfa_fru_write_send()
6228 len = (fru->residue < BFA_FRU_DMA_BUF_SZ) ? in bfa_fru_write_send()
6229 fru->residue : BFA_FRU_DMA_BUF_SZ; in bfa_fru_write_send()
6235 msg->last = (len == fru->residue) ? 1 : 0; in bfa_fru_write_send()
6237 msg->trfr_cmpl = (len == fru->residue) ? fru->trfr_cmpl : 0; in bfa_fru_write_send()
6238 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_write_send()
6239 bfa_alen_set(&msg->alen, len, fru->dbuf_pa); in bfa_fru_write_send()
6241 memcpy(fru->dbuf_kva, fru->ubuf + fru->offset, len); in bfa_fru_write_send()
6242 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_write_send()
6244 fru->residue -= len; in bfa_fru_write_send()
6245 fru->offset += len; in bfa_fru_write_send()
6256 struct bfa_fru_s *fru = cbarg; in bfa_fru_read_send() local
6258 (struct bfi_fru_read_req_s *) fru->mb.msg; in bfa_fru_read_send()
6261 msg->offset = cpu_to_be32(fru->addr_off + fru->offset); in bfa_fru_read_send()
6262 len = (fru->residue < BFA_FRU_DMA_BUF_SZ) ? in bfa_fru_read_send()
6263 fru->residue : BFA_FRU_DMA_BUF_SZ; in bfa_fru_read_send()
6265 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_read_send()
6266 bfa_alen_set(&msg->alen, len, fru->dbuf_pa); in bfa_fru_read_send()
6267 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_read_send()
6295 bfa_fru_attach(struct bfa_fru_s *fru, struct bfa_ioc_s *ioc, void *dev, in bfa_fru_attach() argument
6298 fru->ioc = ioc; in bfa_fru_attach()
6299 fru->trcmod = trcmod; in bfa_fru_attach()
6300 fru->cbfn = NULL; in bfa_fru_attach()
6301 fru->cbarg = NULL; in bfa_fru_attach()
6302 fru->op_busy = 0; in bfa_fru_attach()
6304 bfa_ioc_mbox_regisr(fru->ioc, BFI_MC_FRU, bfa_fru_intr, fru); in bfa_fru_attach()
6305 bfa_q_qe_init(&fru->ioc_notify); in bfa_fru_attach()
6306 bfa_ioc_notify_init(&fru->ioc_notify, bfa_fru_notify, fru); in bfa_fru_attach()
6307 list_add_tail(&fru->ioc_notify.qe, &fru->ioc->notify_q); in bfa_fru_attach()
6311 fru->dbuf_kva = NULL; in bfa_fru_attach()
6312 fru->dbuf_pa = 0; in bfa_fru_attach()
6325 bfa_fru_memclaim(struct bfa_fru_s *fru, u8 *dm_kva, u64 dm_pa, in bfa_fru_memclaim() argument
6331 fru->dbuf_kva = dm_kva; in bfa_fru_memclaim()
6332 fru->dbuf_pa = dm_pa; in bfa_fru_memclaim()
6333 memset(fru->dbuf_kva, 0, BFA_FRU_DMA_BUF_SZ); in bfa_fru_memclaim()
6351 bfa_fruvpd_update(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_fruvpd_update() argument
6354 bfa_trc(fru, BFI_FRUVPD_H2I_WRITE_REQ); in bfa_fruvpd_update()
6355 bfa_trc(fru, len); in bfa_fruvpd_update()
6356 bfa_trc(fru, offset); in bfa_fruvpd_update()
6358 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2 && in bfa_fruvpd_update()
6359 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_update()
6362 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK) in bfa_fruvpd_update()
6365 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_update()
6368 if (fru->op_busy) { in bfa_fruvpd_update()
6369 bfa_trc(fru, fru->op_busy); in bfa_fruvpd_update()
6373 fru->op_busy = 1; in bfa_fruvpd_update()
6375 fru->cbfn = cbfn; in bfa_fruvpd_update()
6376 fru->cbarg = cbarg; in bfa_fruvpd_update()
6377 fru->residue = len; in bfa_fruvpd_update()
6378 fru->offset = 0; in bfa_fruvpd_update()
6379 fru->addr_off = offset; in bfa_fruvpd_update()
6380 fru->ubuf = buf; in bfa_fruvpd_update()
6381 fru->trfr_cmpl = trfr_cmpl; in bfa_fruvpd_update()
6383 bfa_fru_write_send(fru, BFI_FRUVPD_H2I_WRITE_REQ); in bfa_fruvpd_update()
6401 bfa_fruvpd_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_fruvpd_read() argument
6404 bfa_trc(fru, BFI_FRUVPD_H2I_READ_REQ); in bfa_fruvpd_read()
6405 bfa_trc(fru, len); in bfa_fruvpd_read()
6406 bfa_trc(fru, offset); in bfa_fruvpd_read()
6408 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_read()
6411 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK && in bfa_fruvpd_read()
6412 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_read()
6415 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_read()
6418 if (fru->op_busy) { in bfa_fruvpd_read()
6419 bfa_trc(fru, fru->op_busy); in bfa_fruvpd_read()
6423 fru->op_busy = 1; in bfa_fruvpd_read()
6425 fru->cbfn = cbfn; in bfa_fruvpd_read()
6426 fru->cbarg = cbarg; in bfa_fruvpd_read()
6427 fru->residue = len; in bfa_fruvpd_read()
6428 fru->offset = 0; in bfa_fruvpd_read()
6429 fru->addr_off = offset; in bfa_fruvpd_read()
6430 fru->ubuf = buf; in bfa_fruvpd_read()
6431 bfa_fru_read_send(fru, BFI_FRUVPD_H2I_READ_REQ); in bfa_fruvpd_read()
6445 bfa_fruvpd_get_max_size(struct bfa_fru_s *fru, u32 *max_size) in bfa_fruvpd_get_max_size() argument
6447 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_get_max_size()
6450 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_get_max_size()
6453 if (fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK || in bfa_fruvpd_get_max_size()
6454 fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_get_max_size()
6473 bfa_tfru_write(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_tfru_write() argument
6476 bfa_trc(fru, BFI_TFRU_H2I_WRITE_REQ); in bfa_tfru_write()
6477 bfa_trc(fru, len); in bfa_tfru_write()
6478 bfa_trc(fru, offset); in bfa_tfru_write()
6479 bfa_trc(fru, *((u8 *) buf)); in bfa_tfru_write()
6481 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_write()
6484 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_write()
6487 if (fru->op_busy) { in bfa_tfru_write()
6488 bfa_trc(fru, fru->op_busy); in bfa_tfru_write()
6492 fru->op_busy = 1; in bfa_tfru_write()
6494 fru->cbfn = cbfn; in bfa_tfru_write()
6495 fru->cbarg = cbarg; in bfa_tfru_write()
6496 fru->residue = len; in bfa_tfru_write()
6497 fru->offset = 0; in bfa_tfru_write()
6498 fru->addr_off = offset; in bfa_tfru_write()
6499 fru->ubuf = buf; in bfa_tfru_write()
6501 bfa_fru_write_send(fru, BFI_TFRU_H2I_WRITE_REQ); in bfa_tfru_write()
6519 bfa_tfru_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_tfru_read() argument
6522 bfa_trc(fru, BFI_TFRU_H2I_READ_REQ); in bfa_tfru_read()
6523 bfa_trc(fru, len); in bfa_tfru_read()
6524 bfa_trc(fru, offset); in bfa_tfru_read()
6526 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_read()
6529 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_read()
6532 if (fru->op_busy) { in bfa_tfru_read()
6533 bfa_trc(fru, fru->op_busy); in bfa_tfru_read()
6537 fru->op_busy = 1; in bfa_tfru_read()
6539 fru->cbfn = cbfn; in bfa_tfru_read()
6540 fru->cbarg = cbarg; in bfa_tfru_read()
6541 fru->residue = len; in bfa_tfru_read()
6542 fru->offset = 0; in bfa_tfru_read()
6543 fru->addr_off = offset; in bfa_tfru_read()
6544 fru->ubuf = buf; in bfa_tfru_read()
6545 bfa_fru_read_send(fru, BFI_TFRU_H2I_READ_REQ); in bfa_tfru_read()
6559 struct bfa_fru_s *fru = fruarg; in bfa_fru_intr() local
6563 bfa_trc(fru, msg->mh.msg_id); in bfa_fru_intr()
6565 if (!fru->op_busy) { in bfa_fru_intr()
6569 bfa_trc(fru, 0x9999); in bfa_fru_intr()
6577 bfa_trc(fru, status); in bfa_fru_intr()
6579 if (status != BFA_STATUS_OK || fru->residue == 0) { in bfa_fru_intr()
6580 fru->status = status; in bfa_fru_intr()
6581 fru->op_busy = 0; in bfa_fru_intr()
6582 if (fru->cbfn) in bfa_fru_intr()
6583 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6585 bfa_trc(fru, fru->offset); in bfa_fru_intr()
6587 bfa_fru_write_send(fru, in bfa_fru_intr()
6590 bfa_fru_write_send(fru, in bfa_fru_intr()
6597 bfa_trc(fru, status); in bfa_fru_intr()
6600 fru->status = status; in bfa_fru_intr()
6601 fru->op_busy = 0; in bfa_fru_intr()
6602 if (fru->cbfn) in bfa_fru_intr()
6603 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6607 bfa_trc(fru, fru->offset); in bfa_fru_intr()
6608 bfa_trc(fru, len); in bfa_fru_intr()
6610 memcpy(fru->ubuf + fru->offset, fru->dbuf_kva, len); in bfa_fru_intr()
6611 fru->residue -= len; in bfa_fru_intr()
6612 fru->offset += len; in bfa_fru_intr()
6614 if (fru->residue == 0) { in bfa_fru_intr()
6615 fru->status = status; in bfa_fru_intr()
6616 fru->op_busy = 0; in bfa_fru_intr()
6617 if (fru->cbfn) in bfa_fru_intr()
6618 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6621 bfa_fru_read_send(fru, in bfa_fru_intr()
6624 bfa_fru_read_send(fru, in bfa_fru_intr()