2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* GRUB -- GRand Unified Bootloader
|
|
|
|
|
* Copyright (C) 2008 Free Software Foundation, Inc.
|
|
|
|
|
*
|
|
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GRUB_USBTRANS_H
|
|
|
|
|
#define GRUB_USBTRANS_H 1
|
|
|
|
|
|
2013-01-20 21:45:53 +00:00
|
|
|
|
#define MAX_USB_TRANSFER_LEN 0x0800
|
|
|
|
|
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_TRANSFER_TYPE_IN,
|
|
|
|
|
GRUB_USB_TRANSFER_TYPE_OUT,
|
|
|
|
|
GRUB_USB_TRANSFER_TYPE_SETUP
|
|
|
|
|
} grub_transfer_type_t;
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_TRANSACTION_TYPE_CONTROL,
|
|
|
|
|
GRUB_USB_TRANSACTION_TYPE_BULK
|
|
|
|
|
} grub_transaction_type_t;
|
|
|
|
|
|
|
|
|
|
struct grub_usb_transaction
|
|
|
|
|
{
|
|
|
|
|
int size;
|
|
|
|
|
int toggle;
|
|
|
|
|
grub_transfer_type_t pid;
|
2010-05-31 11:58:18 +00:00
|
|
|
|
grub_uint32_t data;
|
2010-07-19 06:43:01 +00:00
|
|
|
|
grub_size_t preceding;
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
};
|
|
|
|
|
typedef struct grub_usb_transaction *grub_usb_transaction_t;
|
|
|
|
|
|
|
|
|
|
struct grub_usb_transfer
|
|
|
|
|
{
|
|
|
|
|
int devaddr;
|
|
|
|
|
|
|
|
|
|
int endpoint;
|
|
|
|
|
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
|
|
int transcnt;
|
|
|
|
|
|
|
|
|
|
int max;
|
|
|
|
|
|
|
|
|
|
grub_transaction_type_t type;
|
|
|
|
|
|
2010-08-21 15:12:51 +00:00
|
|
|
|
grub_transfer_type_t dir;
|
|
|
|
|
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
struct grub_usb_device *dev;
|
|
|
|
|
|
|
|
|
|
struct grub_usb_transaction *transactions;
|
2010-06-01 00:10:19 +00:00
|
|
|
|
|
|
|
|
|
int last_trans;
|
|
|
|
|
/* Index of last processed transaction in OHCI/UHCI driver. */
|
2010-08-21 14:09:43 +00:00
|
|
|
|
|
|
|
|
|
void *controller_data;
|
2010-08-21 15:12:51 +00:00
|
|
|
|
|
|
|
|
|
/* Used when finishing transfer to copy data back. */
|
|
|
|
|
struct grub_pci_dma_chunk *data_chunk;
|
|
|
|
|
void *data;
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
};
|
|
|
|
|
typedef struct grub_usb_transfer *grub_usb_transfer_t;
|
|
|
|
|
|
|
|
|
|
|
2010-08-21 19:55:24 +00:00
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_REQTYPE_TARGET_DEV = (0 << 0),
|
|
|
|
|
GRUB_USB_REQTYPE_TARGET_INTERF = (1 << 0),
|
|
|
|
|
GRUB_USB_REQTYPE_TARGET_ENDP = (2 << 0),
|
|
|
|
|
GRUB_USB_REQTYPE_TARGET_OTHER = (3 << 0),
|
|
|
|
|
GRUB_USB_REQTYPE_STANDARD = (0 << 5),
|
|
|
|
|
GRUB_USB_REQTYPE_CLASS = (1 << 5),
|
|
|
|
|
GRUB_USB_REQTYPE_VENDOR = (2 << 5),
|
|
|
|
|
GRUB_USB_REQTYPE_OUT = (0 << 7),
|
|
|
|
|
GRUB_USB_REQTYPE_IN = (1 << 7),
|
|
|
|
|
GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT = GRUB_USB_REQTYPE_TARGET_INTERF
|
|
|
|
|
| GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_OUT,
|
|
|
|
|
GRUB_USB_REQTYPE_VENDOR_OUT = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_OUT,
|
|
|
|
|
GRUB_USB_REQTYPE_CLASS_INTERFACE_IN = GRUB_USB_REQTYPE_TARGET_INTERF
|
|
|
|
|
| GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_IN,
|
|
|
|
|
GRUB_USB_REQTYPE_VENDOR_IN = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_IN
|
|
|
|
|
};
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
|
2010-08-21 21:09:37 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_REQ_GET_STATUS = 0x00,
|
|
|
|
|
GRUB_USB_REQ_CLEAR_FEATURE = 0x01,
|
|
|
|
|
GRUB_USB_REQ_SET_FEATURE = 0x03,
|
|
|
|
|
GRUB_USB_REQ_SET_ADDRESS = 0x05,
|
|
|
|
|
GRUB_USB_REQ_GET_DESCRIPTOR = 0x06,
|
|
|
|
|
GRUB_USB_REQ_SET_DESCRIPTOR = 0x07,
|
|
|
|
|
GRUB_USB_REQ_GET_CONFIGURATION = 0x08,
|
|
|
|
|
GRUB_USB_REQ_SET_CONFIGURATION = 0x09,
|
|
|
|
|
GRUB_USB_REQ_GET_INTERFACE = 0x0A,
|
|
|
|
|
GRUB_USB_REQ_SET_INTERFACE = 0x0B,
|
|
|
|
|
GRUB_USB_REQ_SYNC_FRAME = 0x0C
|
|
|
|
|
};
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
|
2010-05-31 12:11:41 +00:00
|
|
|
|
#define GRUB_USB_FEATURE_ENDP_HALT 0x00
|
|
|
|
|
#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x01
|
|
|
|
|
#define GRUB_USB_FEATURE_TEST_MODE 0x02
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
|
2010-08-21 21:09:37 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_HUB_FEATURE_PORT_RESET = 0x04,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_PORT_POWER = 0x08,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_C_PORT_CONNECTED = 0x10,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_C_PORT_ENABLED = 0x11,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_C_PORT_SUSPEND = 0x12,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_C_PORT_OVERCURRENT = 0x13,
|
|
|
|
|
GRUB_USB_HUB_FEATURE_C_PORT_RESET = 0x14
|
|
|
|
|
};
|
2010-06-21 19:12:20 +00:00
|
|
|
|
|
2010-08-21 21:09:37 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_CONNECTED = (1 << 0),
|
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_ENABLED = (1 << 1),
|
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_SUSPEND = (1 << 2),
|
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_OVERCURRENT = (1 << 3),
|
2010-08-23 21:28:33 +00:00
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_POWERED = (1 << 8),
|
2010-08-21 21:09:37 +00:00
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_LOWSPEED = (1 << 9),
|
|
|
|
|
GRUB_USB_HUB_STATUS_PORT_HIGHSPEED = (1 << 10),
|
|
|
|
|
GRUB_USB_HUB_STATUS_C_PORT_CONNECTED = (1 << 16),
|
|
|
|
|
GRUB_USB_HUB_STATUS_C_PORT_ENABLED = (1 << 17),
|
|
|
|
|
GRUB_USB_HUB_STATUS_C_PORT_SUSPEND = (1 << 18),
|
|
|
|
|
GRUB_USB_HUB_STATUS_C_PORT_OVERCURRENT = (1 << 19),
|
|
|
|
|
GRUB_USB_HUB_STATUS_C_PORT_RESET = (1 << 20)
|
|
|
|
|
};
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
|
|
|
|
|
struct grub_usb_packet_setup
|
|
|
|
|
{
|
|
|
|
|
grub_uint8_t reqtype;
|
|
|
|
|
grub_uint8_t request;
|
|
|
|
|
grub_uint16_t value;
|
|
|
|
|
grub_uint16_t index;
|
|
|
|
|
grub_uint16_t length;
|
2013-12-15 13:14:30 +00:00
|
|
|
|
} GRUB_PACKED;
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* GRUB_USBTRANS_H */
|