Lines Matching refs:fru
6177 struct bfa_fru_s *fru = cbarg; in bfa_fru_notify() local
6179 bfa_trc(fru, event); in bfa_fru_notify()
6184 if (fru->op_busy) { in bfa_fru_notify()
6185 fru->status = BFA_STATUS_IOC_FAILURE; in bfa_fru_notify()
6186 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_notify()
6187 fru->op_busy = 0; in bfa_fru_notify()
6204 struct bfa_fru_s *fru = cbarg; in bfa_fru_write_send() local
6206 (struct bfi_fru_write_req_s *) fru->mb.msg; in bfa_fru_write_send()
6209 msg->offset = cpu_to_be32(fru->addr_off + fru->offset); in bfa_fru_write_send()
6210 len = (fru->residue < BFA_FRU_DMA_BUF_SZ) ? in bfa_fru_write_send()
6211 fru->residue : BFA_FRU_DMA_BUF_SZ; in bfa_fru_write_send()
6217 msg->last = (len == fru->residue) ? 1 : 0; in bfa_fru_write_send()
6219 msg->trfr_cmpl = (len == fru->residue) ? fru->trfr_cmpl : 0; in bfa_fru_write_send()
6220 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_write_send()
6221 bfa_alen_set(&msg->alen, len, fru->dbuf_pa); in bfa_fru_write_send()
6223 memcpy(fru->dbuf_kva, fru->ubuf + fru->offset, len); in bfa_fru_write_send()
6224 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_write_send()
6226 fru->residue -= len; in bfa_fru_write_send()
6227 fru->offset += len; in bfa_fru_write_send()
6238 struct bfa_fru_s *fru = cbarg; in bfa_fru_read_send() local
6240 (struct bfi_fru_read_req_s *) fru->mb.msg; in bfa_fru_read_send()
6243 msg->offset = cpu_to_be32(fru->addr_off + fru->offset); in bfa_fru_read_send()
6244 len = (fru->residue < BFA_FRU_DMA_BUF_SZ) ? in bfa_fru_read_send()
6245 fru->residue : BFA_FRU_DMA_BUF_SZ; in bfa_fru_read_send()
6247 bfi_h2i_set(msg->mh, BFI_MC_FRU, msg_type, bfa_ioc_portid(fru->ioc)); in bfa_fru_read_send()
6248 bfa_alen_set(&msg->alen, len, fru->dbuf_pa); in bfa_fru_read_send()
6249 bfa_ioc_mbox_queue(fru->ioc, &fru->mb); in bfa_fru_read_send()
6277 bfa_fru_attach(struct bfa_fru_s *fru, struct bfa_ioc_s *ioc, void *dev, in bfa_fru_attach() argument
6280 fru->ioc = ioc; in bfa_fru_attach()
6281 fru->trcmod = trcmod; in bfa_fru_attach()
6282 fru->cbfn = NULL; in bfa_fru_attach()
6283 fru->cbarg = NULL; in bfa_fru_attach()
6284 fru->op_busy = 0; in bfa_fru_attach()
6286 bfa_ioc_mbox_regisr(fru->ioc, BFI_MC_FRU, bfa_fru_intr, fru); in bfa_fru_attach()
6287 bfa_q_qe_init(&fru->ioc_notify); in bfa_fru_attach()
6288 bfa_ioc_notify_init(&fru->ioc_notify, bfa_fru_notify, fru); in bfa_fru_attach()
6289 list_add_tail(&fru->ioc_notify.qe, &fru->ioc->notify_q); in bfa_fru_attach()
6293 fru->dbuf_kva = NULL; in bfa_fru_attach()
6294 fru->dbuf_pa = 0; in bfa_fru_attach()
6307 bfa_fru_memclaim(struct bfa_fru_s *fru, u8 *dm_kva, u64 dm_pa, in bfa_fru_memclaim() argument
6313 fru->dbuf_kva = dm_kva; in bfa_fru_memclaim()
6314 fru->dbuf_pa = dm_pa; in bfa_fru_memclaim()
6315 memset(fru->dbuf_kva, 0, BFA_FRU_DMA_BUF_SZ); in bfa_fru_memclaim()
6333 bfa_fruvpd_update(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_fruvpd_update() argument
6336 bfa_trc(fru, BFI_FRUVPD_H2I_WRITE_REQ); in bfa_fruvpd_update()
6337 bfa_trc(fru, len); in bfa_fruvpd_update()
6338 bfa_trc(fru, offset); in bfa_fruvpd_update()
6340 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2 && in bfa_fruvpd_update()
6341 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_update()
6344 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK) in bfa_fruvpd_update()
6347 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_update()
6350 if (fru->op_busy) { in bfa_fruvpd_update()
6351 bfa_trc(fru, fru->op_busy); in bfa_fruvpd_update()
6355 fru->op_busy = 1; in bfa_fruvpd_update()
6357 fru->cbfn = cbfn; in bfa_fruvpd_update()
6358 fru->cbarg = cbarg; in bfa_fruvpd_update()
6359 fru->residue = len; in bfa_fruvpd_update()
6360 fru->offset = 0; in bfa_fruvpd_update()
6361 fru->addr_off = offset; in bfa_fruvpd_update()
6362 fru->ubuf = buf; in bfa_fruvpd_update()
6363 fru->trfr_cmpl = trfr_cmpl; in bfa_fruvpd_update()
6365 bfa_fru_write_send(fru, BFI_FRUVPD_H2I_WRITE_REQ); in bfa_fruvpd_update()
6383 bfa_fruvpd_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_fruvpd_read() argument
6386 bfa_trc(fru, BFI_FRUVPD_H2I_READ_REQ); in bfa_fruvpd_read()
6387 bfa_trc(fru, len); in bfa_fruvpd_read()
6388 bfa_trc(fru, offset); in bfa_fruvpd_read()
6390 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_read()
6393 if (fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK && in bfa_fruvpd_read()
6394 fru->ioc->attr->card_type != BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_read()
6397 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_read()
6400 if (fru->op_busy) { in bfa_fruvpd_read()
6401 bfa_trc(fru, fru->op_busy); in bfa_fruvpd_read()
6405 fru->op_busy = 1; in bfa_fruvpd_read()
6407 fru->cbfn = cbfn; in bfa_fruvpd_read()
6408 fru->cbarg = cbarg; in bfa_fruvpd_read()
6409 fru->residue = len; in bfa_fruvpd_read()
6410 fru->offset = 0; in bfa_fruvpd_read()
6411 fru->addr_off = offset; in bfa_fruvpd_read()
6412 fru->ubuf = buf; in bfa_fruvpd_read()
6413 bfa_fru_read_send(fru, BFI_FRUVPD_H2I_READ_REQ); in bfa_fruvpd_read()
6427 bfa_fruvpd_get_max_size(struct bfa_fru_s *fru, u32 *max_size) in bfa_fruvpd_get_max_size() argument
6429 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_fruvpd_get_max_size()
6432 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_fruvpd_get_max_size()
6435 if (fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK || in bfa_fruvpd_get_max_size()
6436 fru->ioc->attr->card_type == BFA_MFG_TYPE_CHINOOK2) in bfa_fruvpd_get_max_size()
6455 bfa_tfru_write(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_tfru_write() argument
6458 bfa_trc(fru, BFI_TFRU_H2I_WRITE_REQ); in bfa_tfru_write()
6459 bfa_trc(fru, len); in bfa_tfru_write()
6460 bfa_trc(fru, offset); in bfa_tfru_write()
6461 bfa_trc(fru, *((u8 *) buf)); in bfa_tfru_write()
6463 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_write()
6466 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_write()
6469 if (fru->op_busy) { in bfa_tfru_write()
6470 bfa_trc(fru, fru->op_busy); in bfa_tfru_write()
6474 fru->op_busy = 1; in bfa_tfru_write()
6476 fru->cbfn = cbfn; in bfa_tfru_write()
6477 fru->cbarg = cbarg; in bfa_tfru_write()
6478 fru->residue = len; in bfa_tfru_write()
6479 fru->offset = 0; in bfa_tfru_write()
6480 fru->addr_off = offset; in bfa_tfru_write()
6481 fru->ubuf = buf; in bfa_tfru_write()
6483 bfa_fru_write_send(fru, BFI_TFRU_H2I_WRITE_REQ); in bfa_tfru_write()
6501 bfa_tfru_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset, in bfa_tfru_read() argument
6504 bfa_trc(fru, BFI_TFRU_H2I_READ_REQ); in bfa_tfru_read()
6505 bfa_trc(fru, len); in bfa_tfru_read()
6506 bfa_trc(fru, offset); in bfa_tfru_read()
6508 if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2) in bfa_tfru_read()
6511 if (!bfa_ioc_is_operational(fru->ioc)) in bfa_tfru_read()
6514 if (fru->op_busy) { in bfa_tfru_read()
6515 bfa_trc(fru, fru->op_busy); in bfa_tfru_read()
6519 fru->op_busy = 1; in bfa_tfru_read()
6521 fru->cbfn = cbfn; in bfa_tfru_read()
6522 fru->cbarg = cbarg; in bfa_tfru_read()
6523 fru->residue = len; in bfa_tfru_read()
6524 fru->offset = 0; in bfa_tfru_read()
6525 fru->addr_off = offset; in bfa_tfru_read()
6526 fru->ubuf = buf; in bfa_tfru_read()
6527 bfa_fru_read_send(fru, BFI_TFRU_H2I_READ_REQ); in bfa_tfru_read()
6541 struct bfa_fru_s *fru = fruarg; in bfa_fru_intr() local
6545 bfa_trc(fru, msg->mh.msg_id); in bfa_fru_intr()
6547 if (!fru->op_busy) { in bfa_fru_intr()
6551 bfa_trc(fru, 0x9999); in bfa_fru_intr()
6559 bfa_trc(fru, status); in bfa_fru_intr()
6561 if (status != BFA_STATUS_OK || fru->residue == 0) { in bfa_fru_intr()
6562 fru->status = status; in bfa_fru_intr()
6563 fru->op_busy = 0; in bfa_fru_intr()
6564 if (fru->cbfn) in bfa_fru_intr()
6565 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6567 bfa_trc(fru, fru->offset); in bfa_fru_intr()
6569 bfa_fru_write_send(fru, in bfa_fru_intr()
6572 bfa_fru_write_send(fru, in bfa_fru_intr()
6579 bfa_trc(fru, status); in bfa_fru_intr()
6582 fru->status = status; in bfa_fru_intr()
6583 fru->op_busy = 0; in bfa_fru_intr()
6584 if (fru->cbfn) in bfa_fru_intr()
6585 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6589 bfa_trc(fru, fru->offset); in bfa_fru_intr()
6590 bfa_trc(fru, len); in bfa_fru_intr()
6592 memcpy(fru->ubuf + fru->offset, fru->dbuf_kva, len); in bfa_fru_intr()
6593 fru->residue -= len; in bfa_fru_intr()
6594 fru->offset += len; in bfa_fru_intr()
6596 if (fru->residue == 0) { in bfa_fru_intr()
6597 fru->status = status; in bfa_fru_intr()
6598 fru->op_busy = 0; in bfa_fru_intr()
6599 if (fru->cbfn) in bfa_fru_intr()
6600 fru->cbfn(fru->cbarg, fru->status); in bfa_fru_intr()
6603 bfa_fru_read_send(fru, in bfa_fru_intr()
6606 bfa_fru_read_send(fru, in bfa_fru_intr()