*
* @v dev Underlying hardware device
* @v ports Number of root hub ports
+ * @v mtu Largest transfer allowed on the bus
* @v op Host controller operations
* @ret bus USB bus, or NULL on allocation failure
*/
struct usb_bus * alloc_usb_bus ( struct device *dev, unsigned int ports,
- struct usb_host_operations *op ) {
+ size_t mtu, struct usb_host_operations *op ) {
struct usb_bus *bus;
/* Allocate and initialise structure */
goto err_alloc_bus;
bus->name = dev->name;
bus->dev = dev;
+ bus->mtu = mtu;
bus->op = op;
INIT_LIST_HEAD ( &bus->devices );
INIT_LIST_HEAD ( &bus->hubs );
goto err_reset;
/* Allocate USB bus */
- xhci->bus = alloc_usb_bus ( &pci->dev, xhci->ports,
+ xhci->bus = alloc_usb_bus ( &pci->dev, xhci->ports, XHCI_MTU,
&xhci_operations );
if ( ! xhci->bus ) {
rc = -ENOMEM;
*/
#define XHCI_MIN_ALIGN 64
+/** Maximum transfer size */
+#define XHCI_MTU 65536
+
/** xHCI PCI BAR */
#define XHCI_BAR PCI_BASE_ADDRESS_0
/** Host controller operations set */
struct usb_host_operations *op;
+ /** Largest transfer allowed on the bus */
+ size_t mtu;
+
/** Root hub */
struct usb_hub *hub;
extern void usb_port_changed ( struct usb_port *port );
-extern struct usb_bus * alloc_usb_bus ( struct device *dev, unsigned int ports,
+extern struct usb_bus * alloc_usb_bus ( struct device *dev,
+ unsigned int ports, size_t mtu,
struct usb_host_operations *op );
extern int register_usb_bus ( struct usb_bus *bus );
extern void unregister_usb_bus ( struct usb_bus *bus );