usbtrans.c - wrong max packet size for bulk transfer
This commit is contained in:
parent
441cfe65c0
commit
a94551944e
4 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2010-10-02 Aleš Nesrsta <starous@volny.cz>
|
||||||
|
|
||||||
|
* 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 <phcoder@gmail.com>
|
2010-10-01 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Clear out 0x80 color bit on EFI.
|
Clear out 0x80 color bit on EFI.
|
||||||
|
|
|
@ -150,7 +150,7 @@ typedef enum
|
||||||
#define GRUB_OHCI_RESET_CONNECT_CHANGE (1 << 16)
|
#define GRUB_OHCI_RESET_CONNECT_CHANGE (1 << 16)
|
||||||
#define GRUB_OHCI_CTRL_EDS 256
|
#define GRUB_OHCI_CTRL_EDS 256
|
||||||
#define GRUB_OHCI_BULK_EDS 510
|
#define GRUB_OHCI_BULK_EDS 510
|
||||||
#define GRUB_OHCI_TDS 256
|
#define GRUB_OHCI_TDS 640
|
||||||
|
|
||||||
#define GRUB_OHCI_ED_ADDR_MASK 0x7ff
|
#define GRUB_OHCI_ED_ADDR_MASK 0x7ff
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#define GRUB_UHCI_IOMASK (0x7FF << 5)
|
#define GRUB_UHCI_IOMASK (0x7FF << 5)
|
||||||
|
|
||||||
#define N_QH 256
|
#define N_QH 256
|
||||||
|
#define N_TD 640
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -105,7 +106,7 @@ struct grub_uhci
|
||||||
/* N_QH Queue Heads. */
|
/* N_QH Queue Heads. */
|
||||||
grub_uhci_qh_t qh;
|
grub_uhci_qh_t qh;
|
||||||
|
|
||||||
/* 256 Transfer Descriptors. */
|
/* N_TD Transfer Descriptors. */
|
||||||
grub_uhci_td_t td;
|
grub_uhci_td_t td;
|
||||||
|
|
||||||
/* Free Transfer Descriptors. */
|
/* 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
|
/* The QH pointer of UHCI is only 32 bits, make sure this
|
||||||
code works on on 64 bits architectures. */
|
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)
|
if (! u->qh)
|
||||||
goto fail;
|
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
|
/* The TD pointer of UHCI is only 32 bits, make sure this
|
||||||
code works on on 64 bits architectures. */
|
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)
|
if (! u->td)
|
||||||
goto fail;
|
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
|
/* Link all Transfer Descriptors in a list of available Transfer
|
||||||
Descriptors. */
|
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[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;
|
u->tdfree = u->td;
|
||||||
|
|
||||||
/* Make sure UHCI is disabled! */
|
/* Make sure UHCI is disabled! */
|
||||||
|
|
|
@ -228,7 +228,7 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev,
|
||||||
if (dev->initialized)
|
if (dev->initialized)
|
||||||
{
|
{
|
||||||
struct grub_usb_desc_endp *endpdesc;
|
struct grub_usb_desc_endp *endpdesc;
|
||||||
endpdesc = grub_usb_get_endpdescriptor (dev, 0);
|
endpdesc = grub_usb_get_endpdescriptor (dev, endpoint);
|
||||||
|
|
||||||
if (endpdesc)
|
if (endpdesc)
|
||||||
max = endpdesc->maxpacket;
|
max = endpdesc->maxpacket;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue