Exemplo n.º 1
0
/* ohci "done list" processing needs this mapping */
static inline struct td *
dma_to_td (struct ohci_hcd *hc, dma_addr_t td_dma)
{
	struct td *td;

	td_dma &= TD_MASK;
	td = hc->td_hash [TD_HASH_FUNC(td_dma)];
	while (td && td->td_dma != td_dma)
		td = td->td_hash;
	return td;
}
Exemplo n.º 2
0
static void
td_free (struct ohci_hcd *hc, struct td *td)
{
	struct td	**prev = &hc->td_hash [TD_HASH_FUNC (td->td_dma)];

	while (*prev && *prev != td)
		prev = &(*prev)->td_hash;
	if (*prev)
		*prev = td->td_hash;
	else if ((td->hwINFO & TD_DONE) != 0)
		ohci_dbg (hc, "no hash for td %p\n", td);
	pci_pool_free (hc->td_cache, td, td->td_dma);
}
Exemplo n.º 3
0
/**
 * td_free:删除td,并释放其结构
*/
static void td_free (struct ohci_hcd *hc, struct td *td)
{
	struct td **prev = &hc->td_hash [TD_HASH_FUNC (td->td_dma)];

	while (*prev && *prev != td)
		prev = &(*prev)->td_hash;
	if (*prev)
		*prev = td->td_hash;  /*删除td所指的结构*/
	else if ((td->hwINFO & cpu_to_hc32(hc, TD_DONE)) != 0)
		ohci_dbg (hc, "no hash for td %p\n", td);
	/*将td结构返回给ed_cache DMA缓存池*/
	dma_pool_free (hc->td_cache, td, td->td_dma);
}