• Home
  • Raw
  • Download

Lines Matching refs:poly

113 	struct gf_poly poly;  member
285 static inline int deg(unsigned int poly) in deg() argument
288 return fls(poly)-1; in deg()
352 uint32_t poly; in compute_syndromes() local
365 poly = *ecc++; in compute_syndromes()
367 while (poly) { in compute_syndromes()
368 i = deg(poly); in compute_syndromes()
372 poly ^= (1 << i); in compute_syndromes()
555 static int find_poly_deg1_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg1_roots() argument
560 if (poly->c[0]) in find_poly_deg1_roots()
562 roots[n++] = mod_s(bch, GF_N(bch)-bch->a_log_tab[poly->c[0]]+ in find_poly_deg1_roots()
563 bch->a_log_tab[poly->c[1]]); in find_poly_deg1_roots()
570 static int find_poly_deg2_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg2_roots() argument
576 if (poly->c[0] && poly->c[1]) { in find_poly_deg2_roots()
578 l0 = bch->a_log_tab[poly->c[0]]; in find_poly_deg2_roots()
579 l1 = bch->a_log_tab[poly->c[1]]; in find_poly_deg2_roots()
580 l2 = bch->a_log_tab[poly->c[2]]; in find_poly_deg2_roots()
612 static int find_poly_deg3_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg3_roots() argument
618 if (poly->c[0]) { in find_poly_deg3_roots()
620 e3 = poly->c[3]; in find_poly_deg3_roots()
621 c2 = gf_div(bch, poly->c[0], e3); in find_poly_deg3_roots()
622 b2 = gf_div(bch, poly->c[1], e3); in find_poly_deg3_roots()
623 a2 = gf_div(bch, poly->c[2], e3); in find_poly_deg3_roots()
645 static int find_poly_deg4_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg4_roots() argument
651 if (poly->c[0] == 0) in find_poly_deg4_roots()
655 e4 = poly->c[4]; in find_poly_deg4_roots()
656 d = gf_div(bch, poly->c[0], e4); in find_poly_deg4_roots()
657 c = gf_div(bch, poly->c[1], e4); in find_poly_deg4_roots()
658 b = gf_div(bch, poly->c[2], e4); in find_poly_deg4_roots()
659 a = gf_div(bch, poly->c[3], e4); in find_poly_deg4_roots()
873 *h = &((struct gf_poly_deg1 *)f)[gcd->deg].poly; in factor_polynomial()
885 struct gf_poly *poly, unsigned int *roots) in find_poly_roots() argument
890 switch (poly->deg) { in find_poly_roots()
893 cnt = find_poly_deg1_roots(bch, poly, roots); in find_poly_roots()
896 cnt = find_poly_deg2_roots(bch, poly, roots); in find_poly_roots()
899 cnt = find_poly_deg3_roots(bch, poly, roots); in find_poly_roots()
902 cnt = find_poly_deg4_roots(bch, poly, roots); in find_poly_roots()
907 if (poly->deg && (k <= GF_M(bch))) { in find_poly_roots()
908 factor_polynomial(bch, k, poly, &f1, &f2); in find_poly_roots()
1061 static int build_gf_tables(struct bch_control *bch, unsigned int poly) in build_gf_tables() argument
1064 const unsigned int k = 1 << deg(poly); in build_gf_tables()
1078 x ^= poly; in build_gf_tables()