diff --git a/ChangeLog b/ChangeLog index 9b36f3426..326ce1a44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-10-02 Aleš Nesrsta + + * grub-core/bus/usb/ohci.c, grub-core/bus/usb/uhci.c: + Increased number of TDs. + * grub-core/bus/usb/usbtrans.c (grub_usb_bulk_setup_readwrite): + Corrected endpoint maxpacket size. + 2010-10-01 Vladimir Serbinenko Clear out 0x80 color bit on EFI. diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c index bf5aaa7c0..3c3ce4b89 100644 --- a/grub-core/bus/usb/ohci.c +++ b/grub-core/bus/usb/ohci.c @@ -150,7 +150,7 @@ typedef enum #define GRUB_OHCI_RESET_CONNECT_CHANGE (1 << 16) #define GRUB_OHCI_CTRL_EDS 256 #define GRUB_OHCI_BULK_EDS 510 -#define GRUB_OHCI_TDS 256 +#define GRUB_OHCI_TDS 640 #define GRUB_OHCI_ED_ADDR_MASK 0x7ff diff --git a/grub-core/bus/usb/uhci.c b/grub-core/bus/usb/uhci.c index 711d87d86..d082beac4 100644 --- a/grub-core/bus/usb/uhci.c +++ b/grub-core/bus/usb/uhci.c @@ -29,6 +29,7 @@ #define GRUB_UHCI_IOMASK (0x7FF << 5) #define N_QH 256 +#define N_TD 640 typedef enum { @@ -105,7 +106,7 @@ struct grub_uhci /* N_QH Queue Heads. */ grub_uhci_qh_t qh; - /* 256 Transfer Descriptors. */ + /* N_TD Transfer Descriptors. */ grub_uhci_td_t td; /* Free Transfer Descriptors. */ @@ -213,7 +214,7 @@ grub_uhci_pci_iter (grub_pci_device_t dev, /* The QH pointer of UHCI is only 32 bits, make sure this code works on on 64 bits architectures. */ - u->qh = (grub_uhci_qh_t) grub_memalign (4096, 4096); + u->qh = (grub_uhci_qh_t) grub_memalign (4096, sizeof(struct grub_uhci_qh)*N_QH); if (! u->qh) goto fail; @@ -227,7 +228,7 @@ grub_uhci_pci_iter (grub_pci_device_t dev, /* The TD pointer of UHCI is only 32 bits, make sure this code works on on 64 bits architectures. */ - u->td = (grub_uhci_td_t) grub_memalign (4096, 4096*2); + u->td = (grub_uhci_td_t) grub_memalign (4096, sizeof(struct grub_uhci_td)*N_TD); if (! u->td) goto fail; @@ -244,9 +245,9 @@ grub_uhci_pci_iter (grub_pci_device_t dev, /* Link all Transfer Descriptors in a list of available Transfer Descriptors. */ - for (i = 0; i < 256; i++) + for (i = 0; i < N_TD; i++) u->td[i].linkptr = (grub_uint32_t) (grub_addr_t) &u->td[i + 1]; - u->td[255 - 1].linkptr = 0; + u->td[N_TD - 2].linkptr = 0; u->tdfree = u->td; /* Make sure UHCI is disabled! */ diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c index afd2eb0a5..ebb8a2eb6 100644 --- a/grub-core/bus/usb/usbtrans.c +++ b/grub-core/bus/usb/usbtrans.c @@ -228,7 +228,7 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, if (dev->initialized) { struct grub_usb_desc_endp *endpdesc; - endpdesc = grub_usb_get_endpdescriptor (dev, 0); + endpdesc = grub_usb_get_endpdescriptor (dev, endpoint); if (endpdesc) max = endpdesc->maxpacket;