LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
usbhub.c File Reference
#include "cfe.h"
#include "usbchap9.h"
#include "usbd.h"
Include dependency graph for usbhub.c:

Go to the source code of this file.

Data Structures

struct  usbhub_softc_s
 

Macros

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */
 
#define BUFF_ALIGN   16
 
#define ALIGN(n, align)   (((n)+((align)-1)) & ~((align)-1))
 
#define usb_dma_alloc(n)   (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))
 
#define usb_dma_free(p)   (KFREE(p))
 
#define usbhub_set_port_feature(dev, port, feature)    usb_simple_request(dev,0x23,USB_HUBREQ_SET_FEATURE,feature,port)
 
#define usbhub_set_hub_feature(dev, feature)    usb_simple_request(dev,0x20,USB_HUBREQ_SET_FEATURE,feature,0)
 
#define usbhub_clear_port_feature(dev, port, feature)    usb_simple_request(dev,0x23,USB_HUBREQ_CLEAR_FEATURE,feature,port)
 
#define usbhub_clear_hub_feature(dev, feature)    usb_simple_request(dev,0x20,USB_HUBREQ_CLEAR_FEATURE,feature,0)
 
#define UHUB_MAX_DEVICES   8
 
#define UHUB_FLG_NEEDSCAN   1
 

Typedefs

typedef struct usbhub_softc_s usbhub_softc_t
 

Functions

void usbhub_map_tree (usbbus_t *bus, int(*func)(usbdev_t *dev, void *arg), void *arg)
 
void usbhub_map_from_device (usbdev_t *dev, int(*func)(usbdev_t *dev, void *arg), void *arg)
 
void usbhub_dumpbus (usbbus_t *bus, uint32_t verbose)
 
void usb_scan (usbbus_t *bus)
 

Variables

int usb_noisy
 
usb_driver_t usbhub_driver
 
usb_driver_t usbroothub_driver
 

Macro Definition Documentation

◆ ALIGN

#define ALIGN (   n,
  align 
)    (((n)+((align)-1)) & ~((align)-1))

Definition at line 59 of file usbhub.c.

◆ BUFF_ALIGN

#define BUFF_ALIGN   16

Definition at line 58 of file usbhub.c.

◆ CACHE_ALIGN

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */

Definition at line 57 of file usbhub.c.

◆ UHUB_FLG_NEEDSCAN

#define UHUB_FLG_NEEDSCAN   1

Definition at line 101 of file usbhub.c.

◆ UHUB_MAX_DEVICES

#define UHUB_MAX_DEVICES   8

Definition at line 99 of file usbhub.c.

◆ usb_dma_alloc

#define usb_dma_alloc (   n)    (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))

Definition at line 61 of file usbhub.c.

◆ usb_dma_free

#define usb_dma_free (   p)    (KFREE(p))

Definition at line 62 of file usbhub.c.

◆ usbhub_clear_hub_feature

#define usbhub_clear_hub_feature (   dev,
  feature 
)     usb_simple_request(dev,0x20,USB_HUBREQ_CLEAR_FEATURE,feature,0)

Definition at line 77 of file usbhub.c.

◆ usbhub_clear_port_feature

#define usbhub_clear_port_feature (   dev,
  port,
  feature 
)     usb_simple_request(dev,0x23,USB_HUBREQ_CLEAR_FEATURE,feature,port)

Definition at line 74 of file usbhub.c.

◆ usbhub_set_hub_feature

#define usbhub_set_hub_feature (   dev,
  feature 
)     usb_simple_request(dev,0x20,USB_HUBREQ_SET_FEATURE,feature,0)

Definition at line 71 of file usbhub.c.

◆ usbhub_set_port_feature

#define usbhub_set_port_feature (   dev,
  port,
  feature 
)     usb_simple_request(dev,0x23,USB_HUBREQ_SET_FEATURE,feature,port)

Definition at line 68 of file usbhub.c.

Typedef Documentation

◆ usbhub_softc_t

Function Documentation

◆ usb_scan()

void usb_scan ( usbbus_t bus)

Definition at line 981 of file usbhub.c.

◆ usbhub_dumpbus()

void usbhub_dumpbus ( usbbus_t bus,
uint32_t  verbose 
)

Definition at line 590 of file usbhub.c.

◆ usbhub_map_from_device()

void usbhub_map_from_device ( usbdev_t dev,
int(*)(usbdev_t *dev, void *arg)  func,
void *  arg 
)

Definition at line 537 of file usbhub.c.

◆ usbhub_map_tree()

void usbhub_map_tree ( usbbus_t bus,
int(*)(usbdev_t *dev, void *arg)  func,
void *  arg 
)

Definition at line 532 of file usbhub.c.

Variable Documentation

◆ usb_noisy

int usb_noisy
extern

Definition at line 68 of file usbd.c.

◆ usbhub_driver

usb_driver_t usbhub_driver
Initial value:
= {
"USB Hub",
usbhub_attach,
usbhub_detach
}

Definition at line 114 of file usbhub.c.

◆ usbroothub_driver

usb_driver_t usbroothub_driver
Initial value:
= {
"Root Hub",
usbhub_attach,
usbhub_detach
}

Definition at line 120 of file usbhub.c.