Lines Matching full:ed
113 /* Do not use sizeof(ed / td) as our ed / td structs contain extra members */
179 "of ED) or the remaining buffer size.",
211 static int ep_link(ohci_t * ohci, ed_t * ed);
212 static int ep_unlink(ohci_t * ohci, ed_t * ed);
238 static inline void ed_free(struct ed *ed) in ed_free() argument
240 ed->usb_dev = NULL; in ed_free()
315 /* just for debugging; prints non-empty branches of the int ed tree
329 ed_t *ed = (ed_t *)m32_swap(ed_p); in ep_print_int_eds() local
330 invalidate_dcache_ed(ed); in ep_print_int_eds()
331 printf(" ed: %4x;", ed->hwINFO); in ep_print_int_eds()
332 ed_p = &ed->hwNextED; in ep_print_int_eds()
511 ed_t *ed; in sohci_submit_job() local
531 /* every endpoint has a ed, locate and fill it */ in sohci_submit_job()
532 ed = ep_add_ed(ohci_dev, dev, pipe, interval, 1); in sohci_submit_job()
533 if (!ed) { in sohci_submit_job()
552 ed->purb = urb; in sohci_submit_job()
562 purb_priv->ed = ed; in sohci_submit_job()
577 if (ed->state == ED_NEW || (ed->state & ED_DEL)) { in sohci_submit_job()
583 /* link the ed into a chain if is not already */ in sohci_submit_job()
584 if (ed->state != ED_OPER) in sohci_submit_job()
585 ep_link(ohci, ed); in sohci_submit_job()
587 /* fill the TDs and link it to the ed */ in sohci_submit_job()
606 * ED handling functions
609 /* search for the right branch to insert an interrupt ed into the int tree
658 * ED handling functions
661 /* link an ed into one of the HC chains */
665 volatile ed_t *ed = edi; in ep_link() local
673 ed->state = ED_OPER; in ep_link()
674 ed->int_interval = 0; in ep_link()
676 switch (ed->type) { in ep_link()
678 ed->hwNextED = 0; in ep_link()
679 flush_dcache_ed(ed); in ep_link()
681 ohci_writel((uintptr_t)ed, &ohci->regs->ed_controlhead); in ep_link()
684 m32_swap((unsigned long)ed); in ep_link()
686 ed->ed_prev = ohci->ed_controltail; in ep_link()
696 ed->hwNextED = 0; in ep_link()
697 flush_dcache_ed(ed); in ep_link()
699 ohci_writel((uintptr_t)ed, &ohci->regs->ed_bulkhead); in ep_link()
702 m32_swap((unsigned long)ed); in ep_link()
704 ed->ed_prev = ohci->ed_bulktail; in ep_link()
714 load = ed->int_load; in ep_link()
715 interval = ep_2_n_interval(ed->int_period); in ep_link()
716 ed->int_interval = interval; in ep_link()
718 ed->int_branch = int_branch; in ep_link()
729 ed->hwNextED = *ed_p; in ep_link()
730 flush_dcache_ed(ed); in ep_link()
731 *ed_p = m32_swap((unsigned long)ed); in ep_link()
741 /* scan the periodic table to find and unlink this ED */
742 static void periodic_unlink(struct ohci *ohci, volatile struct ed *ed, in periodic_unlink() argument
750 /* ED might have been unlinked through another path */ in periodic_unlink()
752 if (((struct ed *)(uintptr_t) in periodic_unlink()
753 m32_swap((unsigned long)ed_p)) == ed) { in periodic_unlink()
754 *ed_p = ed->hwNextED; in periodic_unlink()
761 ed_p = &(((struct ed *)(uintptr_t) in periodic_unlink()
767 /* unlink an ed from one of the HC chains.
768 * just the link to the ed is unlinked.
769 * the link from the ed still points to another operational ed or 0
770 * so the HC can eventually finish the processing of the unlinked ed */
774 volatile ed_t *ed = edi; in ep_unlink() local
777 ed->hwINFO |= m32_swap(OHCI_ED_SKIP); in ep_unlink()
778 flush_dcache_ed(ed); in ep_unlink()
780 switch (ed->type) { in ep_unlink()
782 if (ed->ed_prev == NULL) { in ep_unlink()
783 if (!ed->hwNextED) { in ep_unlink()
788 ohci_writel(m32_swap(*((__u32 *)&ed->hwNextED)), in ep_unlink()
791 ed->ed_prev->hwNextED = ed->hwNextED; in ep_unlink()
792 flush_dcache_ed(ed->ed_prev); in ep_unlink()
794 if (ohci->ed_controltail == ed) { in ep_unlink()
795 ohci->ed_controltail = ed->ed_prev; in ep_unlink()
798 *((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev; in ep_unlink()
803 if (ed->ed_prev == NULL) { in ep_unlink()
804 if (!ed->hwNextED) { in ep_unlink()
809 ohci_writel(m32_swap(*((__u32 *)&ed->hwNextED)), in ep_unlink()
812 ed->ed_prev->hwNextED = ed->hwNextED; in ep_unlink()
813 flush_dcache_ed(ed->ed_prev); in ep_unlink()
815 if (ohci->ed_bulktail == ed) { in ep_unlink()
816 ohci->ed_bulktail = ed->ed_prev; in ep_unlink()
819 *((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev; in ep_unlink()
824 periodic_unlink(ohci, ed, 0, 1); in ep_unlink()
825 for (i = ed->int_branch; i < 32; i += ed->int_interval) in ep_unlink()
826 ohci->ohci_int_load[i] -= ed->int_load; in ep_unlink()
829 ed->state = ED_UNLINK; in ep_unlink()
837 * stateless so we do it at every transaction if the state of the ed
839 * ED_UNLINK in all other cases the state is left unchanged the ed
848 volatile ed_t *ed; in ep_add_ed() local
850 ed = ed_ret = &ohci_dev->ed[(usb_pipeendpoint(pipe) << 1) | in ep_add_ed()
853 if ((ed->state & ED_DEL) || (ed->state & ED_URB_DEL)) { in ep_add_ed()
859 if (ed->state == ED_NEW) { in ep_add_ed()
860 /* dummy td; end of td list for ed */ in ep_add_ed()
862 ed->hwTailP = m32_swap((unsigned long)td); in ep_add_ed()
863 ed->hwHeadP = ed->hwTailP; in ep_add_ed()
864 ed->state = ED_UNLINK; in ep_add_ed()
865 ed->type = usb_pipetype(pipe); in ep_add_ed()
869 ed->hwINFO = m32_swap(usb_pipedevice(pipe) in ep_add_ed()
877 if (ed->type == PIPE_INTERRUPT && ed->state == ED_UNLINK) { in ep_add_ed()
878 ed->int_period = interval; in ep_add_ed()
879 ed->int_load = load; in ep_add_ed()
882 flush_dcache_ed(ed); in ep_add_ed()
914 (m32_swap(urb_priv->ed->hwTailP) & ~0xf); in td_fill()
916 td->ed = urb_priv->ed; in td_fill()
941 td->ed->hwTailP = td->hwNextTD; in td_fill()
942 flush_dcache_ed(td->ed); in td_fill()
1045 urb_priv_t *lurb_priv = td->ed->purb; in dl_transfer_length()
1064 urb_priv_t *lurb_priv = td_list->ed->purb; in check_status()
1066 __u32 *phwHeadP = &td_list->ed->hwHeadP; in check_status()
1073 invalidate_dcache_ed(td_list->ed); in check_status()
1086 flush_dcache_ed(td_list->ed); in check_status()
1123 dbg("finish_urb: strange.., ED state %x, \n", status); in finish_urb()
1134 ed_t *ed; in takeback_td() local
1144 ed = td_list->ed; in takeback_td()
1145 lurb_priv = ed->purb; in takeback_td()
1161 finish_urb(ohci, lurb_priv, ed->state); in takeback_td()
1166 if (ed->state != ED_NEW && (!usb_pipeint(lurb_priv->pipe))) { in takeback_td()
1167 invalidate_dcache_ed(ed); in takeback_td()
1168 edHeadP = m32_swap(ed->hwHeadP) & 0xfffffff0; in takeback_td()
1169 edTailP = m32_swap(ed->hwTailP); in takeback_td()
1172 if ((edHeadP == edTailP) && (ed->state == ED_OPER)) in takeback_td()
1173 ep_unlink(ohci, ed); in takeback_td()