Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
xhci.c File Reference
#include <linux/pci.h>
#include <linux/irq.h>
#include <linux/log2.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/dmi.h>
#include "xhci.h"

Go to the source code of this file.

Macros

#define DRIVER_AUTHOR   "Sarah Sharp"
 
#define DRIVER_DESC   "'eXtensible' Host Controller (xHC) Driver"
 

Functions

 module_param (link_quirk, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (link_quirk,"Don't clear the chain bit on a link TRB")
 
int handshake (struct xhci_hcd *xhci, void __iomem *ptr, u32 mask, u32 done, int usec)
 
void xhci_quiesce (struct xhci_hcd *xhci)
 
int xhci_halt (struct xhci_hcd *xhci)
 
int xhci_reset (struct xhci_hcd *xhci)
 
int xhci_init (struct usb_hcd *hcd)
 
int xhci_run (struct usb_hcd *hcd)
 
void xhci_stop (struct usb_hcd *hcd)
 
void xhci_shutdown (struct usb_hcd *hcd)
 
unsigned int xhci_get_endpoint_index (struct usb_endpoint_descriptor *desc)
 
unsigned int xhci_get_endpoint_flag (struct usb_endpoint_descriptor *desc)
 
unsigned int xhci_get_endpoint_flag_from_index (unsigned int ep_index)
 
unsigned int xhci_last_valid_endpoint (u32 added_ctxs)
 
int xhci_urb_enqueue (struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 
int xhci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb, int status)
 
int xhci_drop_endpoint (struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep)
 
int xhci_add_endpoint (struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep)
 
void xhci_drop_ep_from_interval_table (struct xhci_hcd *xhci, struct xhci_bw_info *ep_bw, struct xhci_interval_bw_table *bw_table, struct usb_device *udev, struct xhci_virt_ep *virt_ep, struct xhci_tt_bw_info *tt_info)
 
void xhci_update_tt_active_eps (struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, int old_active_eps)
 
int xhci_check_bandwidth (struct usb_hcd *hcd, struct usb_device *udev)
 
void xhci_reset_bandwidth (struct usb_hcd *hcd, struct usb_device *udev)
 
void xhci_cleanup_stalled_ring (struct xhci_hcd *xhci, struct usb_device *udev, unsigned int ep_index)
 
void xhci_endpoint_reset (struct usb_hcd *hcd, struct usb_host_endpoint *ep)
 
int xhci_alloc_streams (struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, unsigned int num_streams, gfp_t mem_flags)
 
int xhci_free_streams (struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, gfp_t mem_flags)
 
void xhci_free_device_endpoint_resources (struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, bool drop_control_ep)
 
int xhci_discover_or_reset_device (struct usb_hcd *hcd, struct usb_device *udev)
 
void xhci_free_dev (struct usb_hcd *hcd, struct usb_device *udev)
 
int xhci_alloc_dev (struct usb_hcd *hcd, struct usb_device *udev)
 
int xhci_address_device (struct usb_hcd *hcd, struct usb_device *udev)
 
int xhci_set_usb2_hardware_lpm (struct usb_hcd *hcd, struct usb_device *udev, int enable)
 
int xhci_update_device (struct usb_hcd *hcd, struct usb_device *udev)
 
int xhci_enable_usb3_lpm_timeout (struct usb_hcd *hcd, struct usb_device *udev, enum usb3_link_state state)
 
int xhci_disable_usb3_lpm_timeout (struct usb_hcd *hcd, struct usb_device *udev, enum usb3_link_state state)
 
int xhci_update_hub_device (struct usb_hcd *hcd, struct usb_device *hdev, struct usb_tt *tt, gfp_t mem_flags)
 
int xhci_get_frame (struct usb_hcd *hcd)
 
int xhci_gen_setup (struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_LICENSE ("GPL")
 
 module_init (xhci_hcd_init)
 
 module_exit (xhci_hcd_cleanup)
 

Macro Definition Documentation

#define DRIVER_AUTHOR   "Sarah Sharp"

Definition at line 33 of file xhci.c.

#define DRIVER_DESC   "'eXtensible' Host Controller (xHC) Driver"

Definition at line 34 of file xhci.c.

Function Documentation

int handshake ( struct xhci_hcd xhci,
void __iomem ptr,
u32  mask,
u32  done,
int  usec 
)

Definition at line 55 of file xhci.c.

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
module_exit ( xhci_hcd_cleanup  )
module_init ( xhci_hcd_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( link_quirk  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( link_quirk  ,
"Don't clear the chain bit on a link TRB  
)
int xhci_add_endpoint ( struct usb_hcd *  hcd,
struct usb_device *  udev,
struct usb_host_endpoint *  ep 
)

Definition at line 1624 of file xhci.c.

int xhci_address_device ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 3628 of file xhci.c.

int xhci_alloc_dev ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 3551 of file xhci.c.

int xhci_alloc_streams ( struct usb_hcd *  hcd,
struct usb_device *  udev,
struct usb_host_endpoint **  eps,
unsigned int  num_eps,
unsigned int  num_streams,
gfp_t  mem_flags 
)

Definition at line 3030 of file xhci.c.

int xhci_check_bandwidth ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 2641 of file xhci.c.

void xhci_cleanup_stalled_ring ( struct xhci_hcd xhci,
struct usb_device *  udev,
unsigned int  ep_index 
)

Definition at line 2783 of file xhci.c.

int xhci_disable_usb3_lpm_timeout ( struct usb_hcd *  hcd,
struct usb_device *  udev,
enum usb3_link_state  state 
)

Definition at line 4476 of file xhci.c.

int xhci_discover_or_reset_device ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 3296 of file xhci.c.

int xhci_drop_endpoint ( struct usb_hcd *  hcd,
struct usb_device *  udev,
struct usb_host_endpoint *  ep 
)

Definition at line 1538 of file xhci.c.

void xhci_drop_ep_from_interval_table ( struct xhci_hcd xhci,
struct xhci_bw_info ep_bw,
struct xhci_interval_bw_table bw_table,
struct usb_device *  udev,
struct xhci_virt_ep virt_ep,
struct xhci_tt_bw_info tt_info 
)

Definition at line 2274 of file xhci.c.

int xhci_enable_usb3_lpm_timeout ( struct usb_hcd *  hcd,
struct usb_device *  udev,
enum usb3_link_state  state 
)

Definition at line 4470 of file xhci.c.

void xhci_endpoint_reset ( struct usb_hcd *  hcd,
struct usb_host_endpoint *  ep 
)

Definition at line 2824 of file xhci.c.

void xhci_free_dev ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 3475 of file xhci.c.

void xhci_free_device_endpoint_resources ( struct xhci_hcd xhci,
struct xhci_virt_device virt_dev,
bool  drop_control_ep 
)

Definition at line 3257 of file xhci.c.

int xhci_free_streams ( struct usb_hcd *  hcd,
struct usb_device *  udev,
struct usb_host_endpoint **  eps,
unsigned int  num_eps,
gfp_t  mem_flags 
)

Definition at line 3175 of file xhci.c.

int xhci_gen_setup ( struct usb_hcd *  hcd,
xhci_get_quirks_t  get_quirks 
)

Definition at line 4587 of file xhci.c.

unsigned int xhci_get_endpoint_flag ( struct usb_endpoint_descriptor desc)

Definition at line 1098 of file xhci.c.

unsigned int xhci_get_endpoint_flag_from_index ( unsigned int  ep_index)

Definition at line 1107 of file xhci.c.

unsigned int xhci_get_endpoint_index ( struct usb_endpoint_descriptor desc)

xhci_get_endpoint_index - Used for passing endpoint bitmasks between the core and HCDs. Find the index for an endpoint given its descriptor. Use the return value to right shift 1 for the bitmask.

Index = (epnum * 2) + direction - 1, where direction = 0 for OUT, 1 for IN. For control endpoints, the IN index is used (OUT index is unused), so index = (epnum * 2) + direction - 1 = (epnum * 2) + 1 - 1 = (epnum * 2)

Definition at line 1083 of file xhci.c.

int xhci_get_frame ( struct usb_hcd *  hcd)

Definition at line 4580 of file xhci.c.

int xhci_halt ( struct xhci_hcd xhci)

Definition at line 100 of file xhci.c.

int xhci_init ( struct usb_hcd *  hcd)

Definition at line 502 of file xhci.c.

unsigned int xhci_last_valid_endpoint ( u32  added_ctxs)

Definition at line 1118 of file xhci.c.

void xhci_quiesce ( struct xhci_hcd xhci)

Definition at line 76 of file xhci.c.

int xhci_reset ( struct xhci_hcd xhci)

Definition at line 153 of file xhci.c.

void xhci_reset_bandwidth ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 2714 of file xhci.c.

int xhci_run ( struct usb_hcd *  hcd)

Definition at line 609 of file xhci.c.

int xhci_set_usb2_hardware_lpm ( struct usb_hcd *  hcd,
struct usb_device *  udev,
int  enable 
)

Definition at line 4004 of file xhci.c.

void xhci_shutdown ( struct usb_hcd *  hcd)

Definition at line 764 of file xhci.c.

void xhci_stop ( struct usb_hcd *  hcd)

Definition at line 707 of file xhci.c.

int xhci_update_device ( struct usb_hcd *  hcd,
struct usb_device *  udev 
)

Definition at line 4010 of file xhci.c.

int xhci_update_hub_device ( struct usb_hcd *  hcd,
struct usb_device *  hdev,
struct usb_tt *  tt,
gfp_t  mem_flags 
)

Definition at line 4488 of file xhci.c.

void xhci_update_tt_active_eps ( struct xhci_hcd xhci,
struct xhci_virt_device virt_dev,
int  old_active_eps 
)

Definition at line 2410 of file xhci.c.

int xhci_urb_dequeue ( struct usb_hcd *  hcd,
struct urb urb,
int  status 
)

Definition at line 1435 of file xhci.c.

int xhci_urb_enqueue ( struct usb_hcd *  hcd,
struct urb urb,
gfp_t  mem_flags 
)

Definition at line 1234 of file xhci.c.