Lines Matching refs:hdl

57 iaddr_gen(struct mcamd_hdl *hdl, mcamd_node_t *mc, uint64_t pa,  in iaddr_gen()  argument
63 if (!mcamd_get_numprops(hdl, in iaddr_gen()
71 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "iaddr_gen: failed to " in iaddr_gen()
73 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in iaddr_gen()
82 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in iaddr_gen()
85 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_gen: PA 0x%llx not " in iaddr_gen()
88 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in iaddr_gen()
102 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_gen: dram hole " in iaddr_gen()
113 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "Invalid intlven " in iaddr_gen()
115 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in iaddr_gen()
119 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_gen: " in iaddr_gen()
123 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in iaddr_gen()
138 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_gen: PA 0x%llx in range " in iaddr_gen()
153 cs_match(struct mcamd_hdl *hdl, uint64_t iaddr, mcamd_node_t *cs) in cs_match() argument
158 if (!mcamd_get_numprops(hdl, in cs_match()
164 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "cs_match: failed to lookup " in cs_match()
172 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "cs_match: iaddr 0x%llx " in cs_match()
176 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "cs_match: iaddr 0x%llx " in cs_match()
188 cs_sparedto(struct mcamd_hdl *hdl, mcamd_node_t *cs, mcamd_node_t *mc) in cs_sparedto() argument
192 if (!mcamd_get_numprops(hdl, in cs_sparedto()
197 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "cs_sparedto: failed to " in cs_sparedto()
206 for (cs = mcamd_cs_next(hdl, mc, NULL); cs != NULL; in cs_sparedto()
207 cs = mcamd_cs_next(hdl, mc, cs)) { in cs_sparedto()
208 if (!mcamd_get_numprop(hdl, cs, MCAMD_PROP_NUM, &tmpcsnum)) { in cs_sparedto()
209 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "cs_sparedto: " in cs_sparedto()
218 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "cs_sparedto: cs#%d is " in cs_sparedto()
222 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "cs_sparedto: cs#%d is " in cs_sparedto()
237 unum_fill(struct mcamd_hdl *hdl, mcamd_node_t *cs, int which, in unum_fill() argument
245 if ((mc = mcamd_cs_mc(hdl, cs)) == NULL || in unum_fill()
246 !mcamd_get_numprops(hdl, in unum_fill()
251 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "unum_fill: failed to " in unum_fill()
253 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in unum_fill()
257 !mcamd_get_numprop(hdl, cs, MCAMD_PROP_CSDIMM1, &dimm1) || in unum_fill()
259 !mcamd_get_numprop(hdl, cs, MCAMD_PROP_CSDIMM2, &dimm2)) { in unum_fill()
260 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "unum_fill: failed to " in unum_fill()
262 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in unum_fill()
300 for (dimm = mcamd_dimm_next(hdl, mc, NULL); dimm != NULL; in unum_fill()
301 dimm = mcamd_dimm_next(hdl, mc, dimm)) { in unum_fill()
303 if (!mcamd_get_numprop(hdl, dimm, MCAMD_PROP_NUM, &dnum)) { in unum_fill()
304 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "unum_fill: failed " in unum_fill()
313 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "unum_fill: failed to " in unum_fill()
317 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in unum_fill()
324 (void) mc_pa_to_offset(hdl, mc, cs, iaddr, &unump->unum_offset); in unum_fill()
347 mc_whichdimm(struct mcamd_hdl *hdl, mcamd_node_t *cs, uint64_t pa, in mc_whichdimm() argument
361 if (!mcamd_get_numprops(hdl, in mc_whichdimm()
365 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mc_whichdimm: failed to " in mc_whichdimm()
367 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in mc_whichdimm()
371 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mc_whichdimm: found no " in mc_whichdimm()
373 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in mc_whichdimm()
377 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichdimm: just one " in mc_whichdimm()
390 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichdimm: 64/8 " in mc_whichdimm()
395 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichdimm: " in mc_whichdimm()
399 return (mcamd_set_errno(hdl, EMCAMD_INSUFF_RES)); in mc_whichdimm()
406 if (mcamd_cksynd_decode(hdl, synd, &sym, &pat)) { in mc_whichdimm()
411 if (mcamd_cksym_decode(hdl, sym, &lobit, &hibit, &data, in mc_whichdimm()
413 return (mcamd_set_errno(hdl, EMCAMD_SYNDINVALID)); in mc_whichdimm()
416 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichdimm: " in mc_whichdimm()
421 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichdimm: " in mc_whichdimm()
431 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_whichhdimm: " in mc_whichdimm()
443 mc_bkdg_patounum(struct mcamd_hdl *hdl, mcamd_node_t *mc, uint64_t pa, in mc_bkdg_patounum() argument
465 if (!mcamd_get_numprops(hdl, in mc_bkdg_patounum()
467 mc, MCAMD_PROP_REV, &rev, NULL) || !mcamd_get_cfgregs(hdl, in mc_bkdg_patounum()
471 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mc_bkdg_patounm: failed " in mc_bkdg_patounum()
473 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in mc_bkdg_patounum()
493 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_bkdg_patounum: " in mc_bkdg_patounum()
497 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_bkdg_patounum()
518 return (mcamd_set_errno(hdl, in mc_bkdg_patounum()
525 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_bkdg_patounum: " in mc_bkdg_patounum()
528 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_bkdg_patounum()
535 for (cs = mcamd_cs_next(hdl, mc, NULL); cs != NULL; in mc_bkdg_patounum()
536 cs = mcamd_cs_next(hdl, mc, cs)) { in mc_bkdg_patounum()
539 if (!mcamd_get_cfgregs(hdl, in mc_bkdg_patounum()
543 !mcamd_get_numprops(hdl, in mc_bkdg_patounum()
547 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mc_bkdg_patounm: " in mc_bkdg_patounum()
549 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in mc_bkdg_patounum()
573 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_bkdg_patounum: " in mc_bkdg_patounum()
577 if ((sparecs = cs_sparedto(hdl, cs, mc)) != NULL) in mc_bkdg_patounum()
580 if ((which = mc_whichdimm(hdl, cs, pa, valid_lo, in mc_bkdg_patounum()
590 if (unum_fill(hdl, cs, which, InputAddr, unump, 0) < 0) in mc_bkdg_patounum()
597 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mc_bkdg_patounum: in range " in mc_bkdg_patounum()
600 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_bkdg_patounum()
611 mc_patounum(struct mcamd_hdl *hdl, mcamd_node_t *mc, uint64_t pa, in mc_patounum() argument
626 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "BKDG brute-force method begins\n"); in mc_patounum()
627 bkdgres = mc_bkdg_patounum(hdl, mc, pa, valid_lo, synd, in mc_patounum()
629 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "BKDG brute-force method ends\n"); in mc_patounum()
632 if (iaddr_gen(hdl, mc, pa, &iaddr) < 0) in mc_patounum()
635 for (cs = mcamd_cs_next(hdl, mc, NULL); cs != NULL; in mc_patounum()
636 cs = mcamd_cs_next(hdl, mc, cs)) { in mc_patounum()
637 if (cs_match(hdl, iaddr, cs)) in mc_patounum()
642 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_patounum()
651 if ((sparecs = cs_sparedto(hdl, cs, mc)) != NULL) { in mc_patounum()
655 if ((which = mc_whichdimm(hdl, cs, pa, valid_lo, synd, in mc_patounum()
659 if (unum_fill(hdl, cs, which, iaddr, unump, 1) < 0) in mc_patounum()
663 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "bkdgres=%d res=0\n", bkdgres); in mc_patounum()
666 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "BKDG alg failed while " in mc_patounum()
675 mcamd_dprintf(hdl, MCAMD_DBG_ERR, in mc_patounum()
685 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "Result: chip %d mc %d cs %d " in mc_patounum()
693 mcamd_patounum(struct mcamd_hdl *hdl, mcamd_node_t *root, uint64_t pa, in mcamd_patounum() argument
699 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mcamd_patounum: pa=0x%llx, " in mcamd_patounum()
703 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mcamd_patounum: require " in mcamd_patounum()
705 return (mcamd_set_errno(hdl, EMCAMD_INSUFF_RES)); in mcamd_patounum()
708 if (!mcamd_synd_validate(hdl, synd, syndtype)) in mcamd_patounum()
709 return (mcamd_set_errno(hdl, EMCAMD_SYNDINVALID)); in mcamd_patounum()
711 for (mc = mcamd_mc_next(hdl, root, NULL); mc != NULL; in mcamd_patounum()
712 mc = mcamd_mc_next(hdl, root, mc)) { in mcamd_patounum()
713 if (mc_patounum(hdl, mc, pa, valid_lo, synd, in mcamd_patounum()
717 if (mcamd_errno(hdl) != EMCAMD_NOADDR) in mcamd_patounum()