Lines Matching refs:pdi

87 struct pdi {  struct
130 pdi_id(const struct pdi *pdi) in pdi_id() argument
132 return le16_to_cpu(pdi->id); in pdi_id()
137 pdi_len(const struct pdi *pdi) in pdi_len() argument
139 return 2 * (le16_to_cpu(pdi->len) - 1); in pdi_len()
175 static const struct pdi *
176 hermes_find_pdi(const struct pdi *first_pdi, u32 record_id, const void *end) in hermes_find_pdi()
178 const struct pdi *pdi = first_pdi; in hermes_find_pdi() local
180 end -= sizeof(struct pdi); in hermes_find_pdi()
182 while (((void *) pdi <= end) && in hermes_find_pdi()
183 (pdi_id(pdi) != PDI_END)) { in hermes_find_pdi()
186 if (pdi_id(pdi) == record_id) in hermes_find_pdi()
187 return pdi; in hermes_find_pdi()
189 pdi = (struct pdi *) &pdi->data[pdi_len(pdi)]; in hermes_find_pdi()
197 const struct pdi *pdi, const void *pdr_end) in hermes_plug_pdi() argument
202 pdr = hermes_find_pdr(first_pdr, pdi_id(pdi), pdr_end); in hermes_plug_pdi()
209 if (pdi_len(pdi) != pdr_len(pdr)) in hermes_plug_pdi()
213 hw->ops->program(hw, pdi->data, pdr_addr(pdr), pdi_len(pdi)); in hermes_plug_pdi()
230 const struct pdi *pdi; in hermes_apply_pda() local
234 pda_end -= sizeof(struct pdi); in hermes_apply_pda()
237 pdi = (const struct pdi *) (pda + 2); in hermes_apply_pda()
238 while (((void *) pdi <= pda_end) && in hermes_apply_pda()
239 (pdi_id(pdi) != PDI_END)) { in hermes_apply_pda()
240 ret = hermes_plug_pdi(hw, pdr, pdi, pdr_end); in hermes_apply_pda()
245 pdi = (const struct pdi *) &pdi->data[pdi_len(pdi)]; in hermes_apply_pda()
397 const struct pdi *first_pdi = (const struct pdi *) &pda[2]; in hermes_apply_pda_with_defaults()
398 const struct pdi *pdi; in hermes_apply_pda_with_defaults() local
399 const struct pdi *default_pdi = NULL; in hermes_apply_pda_with_defaults()
400 const struct pdi *outdoor_pdi; in hermes_apply_pda_with_defaults()
417 pdi = hermes_find_pdi(first_pdi, record_id, pda_end); in hermes_apply_pda_with_defaults()
418 if (pdi) in hermes_apply_pda_with_defaults()
420 record_id, pdi); in hermes_apply_pda_with_defaults()
429 pdi = outdoor_pdi; in hermes_apply_pda_with_defaults()
432 record_id + 1, pdi); in hermes_apply_pda_with_defaults()
436 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0005); in hermes_apply_pda_with_defaults()
439 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0108); in hermes_apply_pda_with_defaults()
442 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0109); in hermes_apply_pda_with_defaults()
445 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0150); in hermes_apply_pda_with_defaults()
448 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0160); in hermes_apply_pda_with_defaults()
451 default_pdi = (struct pdi *) &DEFAULT_PDR(0x0161); in hermes_apply_pda_with_defaults()
457 if (!pdi && default_pdi) { in hermes_apply_pda_with_defaults()
459 pdi = default_pdi; in hermes_apply_pda_with_defaults()
461 record_id, pdi); in hermes_apply_pda_with_defaults()
464 if (pdi) { in hermes_apply_pda_with_defaults()
466 if ((pdi_len(pdi) == pdr_len(pdr)) && in hermes_apply_pda_with_defaults()
467 ((void *) pdi->data + pdi_len(pdi) < pda_end)) { in hermes_apply_pda_with_defaults()
469 hw->ops->program(hw, pdi->data, pdr_addr(pdr), in hermes_apply_pda_with_defaults()
470 pdi_len(pdi)); in hermes_apply_pda_with_defaults()