Allow psartial transfers and use them for usbserial

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-07-19 08:43:01 +02:00
parent 824e1447ac
commit 34787305df
10 changed files with 93 additions and 59 deletions

View file

@ -67,8 +67,6 @@ struct grub_serial_port
struct grub_serial_driver *driver;
struct grub_serial_config config;
int configured;
char buf[64];
int bufstart, bufend;
/* This should be void *data but since serial is useful as an early console
when malloc isn't available it's a union.
*/
@ -80,6 +78,8 @@ struct grub_serial_port
grub_usb_device_t usbdev;
int configno;
int interfno;
char buf[64];
int bufstart, bufend;
struct grub_usb_desc_endp *in_endp;
struct grub_usb_desc_endp *out_endp;
};

View file

@ -107,7 +107,7 @@ struct grub_usb_controller_dev
grub_usb_err_t (*transfer) (grub_usb_controller_t dev,
grub_usb_transfer_t transfer,
int timeout);
int timeout, grub_size_t *actual);
int (*hubports) (grub_usb_controller_t dev);
@ -240,8 +240,8 @@ void grub_usb_poll_devices (void);
void grub_usb_device_attach (grub_usb_device_t dev);
grub_usb_err_t
grub_usb_bulk_read_timeout (grub_usb_device_t dev,
int endpoint, grub_size_t size, char *data,
int timeout);
grub_usb_bulk_read_extended (grub_usb_device_t dev,
int endpoint, grub_size_t size, char *data,
int timeout, grub_size_t *actual);
#endif /* GRUB_USB_H */

View file

@ -28,4 +28,7 @@ void grub_usbserial_detach (grub_usb_device_t usbdev, int configno,
int
grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno,
struct grub_serial_driver *driver);
int
grub_usbserial_fetch (struct grub_serial_port *port, grub_size_t header_size);
#endif

View file

@ -38,6 +38,7 @@ struct grub_usb_transaction
int toggle;
grub_transfer_type_t pid;
grub_uint32_t data;
grub_size_t preceding;
};
typedef struct grub_usb_transaction *grub_usb_transaction_t;