static struct ehci_qtd *ehci_qtd_alloc(struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; if (use_iram_qtd) { dma = usb_malloc(sizeof(struct ehci_qtd), flags); if (dma != 0) qtd = (struct ehci_qtd *)IO_ADDRESS(dma); else qtd = dma_pool_alloc(ehci->qtd_pool, flags, &dma); } else qtd = dma_pool_alloc(ehci->qtd_pool, flags, &dma); if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); ++g_debug_qtd_allocated; } else { panic ("out of i-ram for qtd allocation g_debug_qtd_allocated %d \ size%d \n", g_debug_qtd_allocated, sizeof(struct ehci_qtd)); } return qtd; }
void create_qtd_dummy(void) { int n; struct ehci_qtd * qtd, *qtd_next; qtd=qtd_dummy_first; for(n=0;;n++) { qtd_next=(struct ehci_qtd *) (((((u32) qtd)+sizeof(struct ehci_qtd)+31) & ~31)); ehci_qtd_init(qtd); //qtd_fill( qtd, 0, 0, QTD_STS_HALT, 0); if(n<3) { qtd->hw_next= QTD_NEXT(qtd_next->qtd_dma); qtd->hw_alt_next= EHCI_LIST_END(); //QTD_NEXT(qtd_next->qtd_dma); ehci_dma_map_bidir((void *) qtd,sizeof(struct ehci_qtd)); } else { ehci_dma_map_bidir(qtd,sizeof(struct ehci_qtd)); break; } qtd=qtd_next; } }
static inline struct ehci_qtd * ehci_qtd_alloc(void) { struct ehci_qtd *qtd ; //debug_printf("ehci_qtd used=%x\n",ehci->qtd_used); BUG_ON(ehci->qtd_used>=EHCI_MAX_QTD); qtd = ehci->qtds[ehci->qtd_used++]; ehci_qtd_init(qtd); return qtd; }
static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); } return qtd; }
static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, int flags) { struct ehci_qtd *qtd; dma_addr_t dma; qtd = pci_pool_alloc (ehci->qtd_pool, flags, &dma); if (qtd != 0) { ehci_qtd_init (qtd, dma); } return qtd; }
static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) { struct ehci_qtd *qtd; dma_addr_t dma; qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); /* tony.yu map between PHY addr & BUS addr */ #if defined(CONFIG_ARM) && (MP_USB_MSTAR==1) dma = BUS2PA(dma); #endif if (qtd != NULL) { ehci_qtd_init(ehci, qtd, dma); } return qtd; }
static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, int flags) { struct ehci_qtd *qtd; void* real; real = kmalloc( sizeof( struct ehci_qtd ) + 32, MEMF_KERNEL | MEMF_CLEAR ); qtd = ( struct ehci_qtd* )( ((uint32)real + 32 ) & ~31 ); #if 0 qtd = pci_pool_alloc (ehci->qtd_pool, flags, real); #endif if (real != 0) { ehci_qtd_init (qtd, real); } return qtd; }