Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
c67x00-sched.c File Reference
#include <linux/kthread.h>
#include <linux/slab.h>
#include "c67x00.h"
#include "c67x00-hcd.h"

Go to the source code of this file.

Data Structures

struct  c67x00_ep_data
 
struct  c67x00_td
 
struct  c67x00_urb_priv
 

Macros

#define SETUP_STAGE   0
 
#define DATA_STAGE   1
 
#define STATUS_STAGE   2
 
#define TT_OFFSET   2
 
#define TT_CONTROL   0
 
#define TT_ISOCHRONOUS   1
 
#define TT_BULK   2
 
#define TT_INTERRUPT   3
 
#define td_udev(td)   ((td)->ep_data->dev)
 
#define CY_TD_SIZE   12
 
#define TD_PIDEP_OFFSET   0x04
 
#define TD_PIDEPMASK_PID   0xF0
 
#define TD_PIDEPMASK_EP   0x0F
 
#define TD_PORTLENMASK_DL   0x02FF
 
#define TD_PORTLENMASK_PN   0xC000
 
#define TD_STATUS_OFFSET   0x07
 
#define TD_STATUSMASK_ACK   0x01
 
#define TD_STATUSMASK_ERR   0x02
 
#define TD_STATUSMASK_TMOUT   0x04
 
#define TD_STATUSMASK_SEQ   0x08
 
#define TD_STATUSMASK_SETUP   0x10
 
#define TD_STATUSMASK_OVF   0x20
 
#define TD_STATUSMASK_NAK   0x40
 
#define TD_STATUSMASK_STALL   0x80
 
#define TD_ERROR_MASK
 
#define TD_RETRYCNT_OFFSET   0x08
 
#define TD_RETRYCNTMASK_ACT_FLG   0x10
 
#define TD_RETRYCNTMASK_TX_TYPE   0x0C
 
#define TD_RETRYCNTMASK_RTY_CNT   0x03
 
#define TD_RESIDUE_OVERFLOW   0x80
 
#define TD_PID_IN   0x90
 
#define td_residue(td)   ((__s8)(td->residue))
 
#define td_ly_base_addr(td)   (__le16_to_cpu((td)->ly_base_addr))
 
#define td_port_length(td)   (__le16_to_cpu((td)->port_length))
 
#define td_next_td_addr(td)   (__le16_to_cpu((td)->next_td_addr))
 
#define td_active(td)   ((td)->retry_cnt & TD_RETRYCNTMASK_ACT_FLG)
 
#define td_length(td)   (td_port_length(td) & TD_PORTLENMASK_DL)
 
#define td_sequence_ok(td)
 
#define td_acked(td)
 
#define td_actual_bytes(td)   (td_length(td) - td_residue(td))
 

Functions

void c67x00_endpoint_disable (struct usb_hcd *hcd, struct usb_host_endpoint *ep)
 
int c67x00_urb_enqueue (struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 
int c67x00_urb_dequeue (struct usb_hcd *hcd, struct urb *urb, int status)
 
void c67x00_sched_kick (struct c67x00_hcd *c67x00)
 
int c67x00_sched_start_scheduler (struct c67x00_hcd *c67x00)
 
void c67x00_sched_stop_scheduler (struct c67x00_hcd *c67x00)
 

Macro Definition Documentation

#define CY_TD_SIZE   12

Definition at line 98 of file c67x00-sched.c.

#define DATA_STAGE   1

Definition at line 35 of file c67x00-sched.c.

#define SETUP_STAGE   0

Definition at line 34 of file c67x00-sched.c.

#define STATUS_STAGE   2

Definition at line 36 of file c67x00-sched.c.

#define td_acked (   td)
Value:

Definition at line 141 of file c67x00-sched.c.

#define td_active (   td)    ((td)->retry_cnt & TD_RETRYCNTMASK_ACT_FLG)

Definition at line 134 of file c67x00-sched.c.

#define td_actual_bytes (   td)    (td_length(td) - td_residue(td))

Definition at line 143 of file c67x00-sched.c.

#define TD_ERROR_MASK
Value:
TD_STATUSMASK_STALL)

Definition at line 116 of file c67x00-sched.c.

#define td_length (   td)    (td_port_length(td) & TD_PORTLENMASK_DL)

Definition at line 135 of file c67x00-sched.c.

#define td_ly_base_addr (   td)    (__le16_to_cpu((td)->ly_base_addr))

Definition at line 130 of file c67x00-sched.c.

#define td_next_td_addr (   td)    (__le16_to_cpu((td)->next_td_addr))

Definition at line 132 of file c67x00-sched.c.

#define TD_PID_IN   0x90

Definition at line 126 of file c67x00-sched.c.

#define TD_PIDEP_OFFSET   0x04

Definition at line 100 of file c67x00-sched.c.

#define TD_PIDEPMASK_EP   0x0F

Definition at line 102 of file c67x00-sched.c.

#define TD_PIDEPMASK_PID   0xF0

Definition at line 101 of file c67x00-sched.c.

#define td_port_length (   td)    (__le16_to_cpu((td)->port_length))

Definition at line 131 of file c67x00-sched.c.

#define TD_PORTLENMASK_DL   0x02FF

Definition at line 103 of file c67x00-sched.c.

#define TD_PORTLENMASK_PN   0xC000

Definition at line 104 of file c67x00-sched.c.

#define td_residue (   td)    ((__s8)(td->residue))

Definition at line 129 of file c67x00-sched.c.

#define TD_RESIDUE_OVERFLOW   0x80

Definition at line 124 of file c67x00-sched.c.

#define TD_RETRYCNT_OFFSET   0x08

Definition at line 119 of file c67x00-sched.c.

#define TD_RETRYCNTMASK_ACT_FLG   0x10

Definition at line 120 of file c67x00-sched.c.

#define TD_RETRYCNTMASK_RTY_CNT   0x03

Definition at line 122 of file c67x00-sched.c.

#define TD_RETRYCNTMASK_TX_TYPE   0x0C

Definition at line 121 of file c67x00-sched.c.

#define td_sequence_ok (   td)
Value:
(!td->status || \
!(td->ctrl_reg & SEQ_SEL)))

Definition at line 137 of file c67x00-sched.c.

#define TD_STATUS_OFFSET   0x07

Definition at line 106 of file c67x00-sched.c.

#define TD_STATUSMASK_ACK   0x01

Definition at line 107 of file c67x00-sched.c.

#define TD_STATUSMASK_ERR   0x02

Definition at line 108 of file c67x00-sched.c.

#define TD_STATUSMASK_NAK   0x40

Definition at line 113 of file c67x00-sched.c.

#define TD_STATUSMASK_OVF   0x20

Definition at line 112 of file c67x00-sched.c.

#define TD_STATUSMASK_SEQ   0x08

Definition at line 110 of file c67x00-sched.c.

#define TD_STATUSMASK_SETUP   0x10

Definition at line 111 of file c67x00-sched.c.

#define TD_STATUSMASK_STALL   0x80

Definition at line 114 of file c67x00-sched.c.

#define TD_STATUSMASK_TMOUT   0x04

Definition at line 109 of file c67x00-sched.c.

#define td_udev (   td)    ((td)->ep_data->dev)

Definition at line 96 of file c67x00-sched.c.

#define TT_BULK   2

Definition at line 68 of file c67x00-sched.c.

#define TT_CONTROL   0

Definition at line 66 of file c67x00-sched.c.

#define TT_INTERRUPT   3

Definition at line 69 of file c67x00-sched.c.

#define TT_ISOCHRONOUS   1

Definition at line 67 of file c67x00-sched.c.

#define TT_OFFSET   2

Definition at line 65 of file c67x00-sched.c.

Function Documentation

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

Definition at line 329 of file c67x00-sched.c.

void c67x00_sched_kick ( struct c67x00_hcd c67x00)

Definition at line 1156 of file c67x00-sched.c.

int c67x00_sched_start_scheduler ( struct c67x00_hcd c67x00)

Definition at line 1161 of file c67x00-sched.c.

void c67x00_sched_stop_scheduler ( struct c67x00_hcd c67x00)

Definition at line 1168 of file c67x00-sched.c.

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

Definition at line 465 of file c67x00-sched.c.

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

Definition at line 366 of file c67x00-sched.c.