*Changed the ehci_bulk_message buffer address, which fixes the gameid when using WiiRd
*Some code clean up


git-svn-id: svn://localhost/Users/andi/Downloads/code/trunk@15 be6c1b03-d731-4111-a574-e37d80d43941
This commit is contained in:
crediar@rypp.net 2012-06-30 04:38:56 +00:00
parent d103461fa9
commit 0dabbeeb80
2 changed files with 17 additions and 24 deletions

View File

@ -42,44 +42,37 @@ static inline struct ehci_qtd * ehci_qtd_alloc(void)
int ehci_mem_init (void)
{
int i;
u32 ptr = 0x17FF000;
// ehci->periodic = ehci_maligned(DEFAULT_I_TDPS * sizeof(__le32),32,4096);
u32 ptr = 0x1800000 - DEFAULT_I_TDPS * sizeof(__le32);
ehci->periodic = (u32*)ptr;
ehci->periodic_dma = ehci_virt_to_dma(ehci->periodic);
for (i = 0; i < DEFAULT_I_TDPS; i++)
ehci->periodic[i] = EHCI_LIST_END();
ehci_writel(ehci->periodic_dma, &ehci->regs->frame_list);
ehci_writel( ehci->periodic_dma, &ehci->regs->frame_list );
for(i=0;i<EHCI_MAX_QTD;i++)
{
// ehci->qtds[i] = ehci_maligned(sizeof(struct ehci_qtd),32,4096);
ptr -= sizeof(struct ehci_qtd);
{
ptr -= sizeof(struct ehci_qtd);
ehci->qtds[i] = (struct ehci_qtd*)(ptr);
}
ehci->qtd_used = 0;
// ehci->asyncqh = ehci_maligned(sizeof(struct ehci_qh),32,4096);
ptr -= sizeof(struct ehci_qh);
ptr -= sizeof(struct ehci_qh);
ehci->asyncqh = (struct ehci_qh*)ptr;
ehci->asyncqh->ehci = ehci;
ehci->asyncqh->qh_dma = ehci_virt_to_dma(ehci->asyncqh);
ehci->asyncqh->qtd_head = NULL;
// ehci->async = ehci_maligned(sizeof(struct ehci_qh),32,4096);
ptr -= sizeof(struct ehci_qh);
ehci->asyncqh->ehci = ehci;
ehci->asyncqh->qh_dma = ehci_virt_to_dma(ehci->asyncqh);
ehci->asyncqh->qtd_head = NULL;
ptr -= sizeof(struct ehci_qh);
ehci->async = (struct ehci_qh*)ptr;
ehci->async->ehci = ehci;
ehci->async->qh_dma = ehci_virt_to_dma(ehci->async);
ehci->async->qtd_head = NULL;
ehci->async->ehci = ehci;
ehci->async->qh_dma = ehci_virt_to_dma(ehci->async);
ehci->async->qtd_head = NULL;
return 0;
return 0;
}

6
ehci.c
View File

@ -637,13 +637,13 @@ s32 ehci_bulk_message(struct ehci_device *dev,u8 bEndpoint,u16 wLength,void *rpD
// hexdump( urb.transfer_buffer, urb.transfer_buffer_length );
if( ((u32)rpData >> 28) == 0xF )
{
memcpy( (void*)0x1800, rpData, wLength );
memcpy( (void*)0xFE0, rpData, wLength );
urb.transfer_buffer = (u8*)0x1800;
urb.transfer_buffer = (u8*)0xFE0;
ret = ehci_do_urb( dev, &urb );
memcpy( rpData, (void*)0x1800, wLength );
memcpy( rpData, (void*)0xFE0, wLength );
} else {
ret = ehci_do_urb( dev, &urb );