products/Sources/formale Sprachen/C/Linux/drivers/usb/host/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 24.10.2025 mit Größe 110 kB image not shown  

SSL oxu210hp-hcd.c   Interaktion und
PortierbarkeitC

 
// SPDX-License-Identifier: GPL-2.0+

 *##define java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
otech@eurtech>
 *
 * Thisdefine() ()>80) /* bits 11:8, ports per CC */
   chip   compatible
 */

HCS_PPC) (p)(1< ) /* true: port power control */HCS_N_PORTSp) (p>0&0) /* bits 3:0, ports on HC */
#</pci
#include <linux/dmapooldefine(p       p)1< ) /
#include <linux/kernel.h>
#include <linux/delay.h>
<linuxioport.>
#include <linuxdefine( ()( < )  * true: periodic_size changes*/
<linux.h>
#include <linux/ u8 portroute[8];  /* nibbles  - offset xC
#include
#include
#include
#include <linux/.h>
#include <linux/usb.h>
#include <linux ehci_regs
#include  /* USBCMD: offset 0x00 */
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/iopoll.h>

#include <asm/irq.h>
#include <linux/unaligned.h>

#include <linux/irq.h>
#include <linux/platform_device.h>

#define DRIVER_VERSION "0.0.50"

#define OXU_DEVICEID   0x00
 #define OXU_REV_MASK  0xffff0000
 #define OXU_REV_SHIFT6
 #define OXU_REV_2100  0x2100
 #define OXU_BO_SHIFTdefine (1<1) /* enable "park" on async qh */
 #define OXU_BO_MASK  CMD_PARK_CNTc)(()>)3 /* how many transfers to park for */ transfers parkfor *
 #define OXU_MAJ_REV_SHIFT 4
 ##efine (1<) * "doorbell" interrupt async advance */   (<5  /* async schedule enable */
 #define OXU_MIN_REV_SHIFT 0
 #define OXU_MIN_REV_MASK java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
#define OXU_HOSTIFCONFIG
#define OXU_SOFTRESET   java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
 #define OXU_SRESET( < 0

#define OXU_PIOBURSTREADCTRL  0x0C STS_RECL(<13 /

#defineSTS_HALT1<2  /* Not running (any reason) */
define  0
#define OXU_CHIPIRQEN_CLR  (<4 /
#define OXU_USBSPHLPWUI 0x00000080
#define OXU_USBOTGLPWUI 0x00000040
#define OXU_USBSPHI 0x00000002
#define OXU_USBOTGI 0x00000001

#define OXU_CLKCTRL_SET 0x1C
#define OXU_SYSCLKEN 0x00000008
#define OXU_USBSPHCLKEN 0x00000002
#define OXU_USBOTGCLKEN 0x00000001

#define OXU_ASO 0x68
#define OXU_SPHPOEN 0x00000100
#define OXU_OVRCCURPUPDEN 0x00000800
#define OXU_ASO_OP (1 << 10)
#define OXU_COMPARATOR 0x000004000

#define OXU_USBMODE 0x1A8
#define OXU_VBPS 0x00000020
#define OXU_ES_LITTLE 0x00000000
#define OXU_CM_HOST_ONLY 0x00000003

/*
 * Proper EHCI structs & defines
 */


/* Magic numbers that can affect system performance */ (<) 
#define EHCI_TUNE_CERR 3 /* 0-3 qtd retries; 0 == don't stop */

#define   intr_enable
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
d  1 /* 1-3 transactions/uframe; 4.10.3 */
#define EHCI_TUNE_MULT_TT  /* CTRLDSSEGMENT: offset 0x10 */
#define   2/* (small) 256 frame schedule */

struct oxu_hcd/* PERIODICLISTBASE: offset 0x14 */

/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */

/* Section 2.2 Host Controller Capability Registers */
struct 
 /* these fields are specified as 8 and 16 bit registers,
 * but some hosts can't perform 8 or 16 bit PCI accesses.
 */

  /* PORTSC
define(p (()>0)0) /* bits 7:0 */
## PORT_WKOC_E1<2 /
u32;     
#define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */

#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */
Cs *java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
define(p (()>)0) /* bits 11:8, ports per CC */
#define HCS_PORTROUTED(p) ( 1:6forport  */
define(p) (&(1< ) /* true: port power control */
#define HCS_N_PORTS(p)  (((p)>>0)&0xf) /* bits 3:0, ports on HC */

 u32  hcc_params;      /* HCCPARAMS - offset 0x8 */
#define (<<1java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
#define HCC_ISOC_CACHE(p)#PORT_POWER(<<2 java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
defineHCC_ISOC_THRESp       ()>)0)  /* bits 6:4, uframes cached */
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
#define HCC_PGM_FRAMELISTLEN(pjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
#define HCC_64BIT_ADDR(p#definePORT_SUSPEND<7 /
 u8 PORT_RESUME<<) /* resume it */
}_;


/* Section 2.3 Host Controller Operational Registers */
struct {
 /* USBCMD: offset 0x00 */
 u32   (<) /* port enable */
/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ (<0 /
define (1<1 /
#define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ _;
 /* partial reset (no ports, etc) */
#definejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* QTD: describe data transfer * See Fig 3  
define</* schedule /
/* 3:2 is periodic frame list size */
#define CMD_RESET (1<< _   ;  /* see EHCI 3.5.1 */
#define CMD_RUN  (1<<0)  /* start/stop HC */

 /* USBSTS: offset 0x04 */
 u32  status;
#define STS_ASS  (1<<15)  __e32  hw_alt_next  /* see EHCI 3.5.2 */
defineSTS_PSS 1<<4 
#define STS_RECL (1<<13) /* Reclamation */

#define STS_HALT (1<<12)  /* Not running (any reason) */
/* some bits reserved */
 /* these STS_* flags are also intr_enable bits (USBINTR) */  (1< 1)/* data toggle */
#define STS_IAA(<5 /* Interrupted on advance *java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
#define #define() ((tok0) & x3
STS_FLR<) *frame rolled *java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
STS_PCD  1<2) /* port change detect */
#define STS_ERR  (1<<1)  /* "error" completion (overflow, ...) */
#define STS_INT  (1QTD_STS_HALT < )/java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)

 /* USBINTR: offset 0x08 */
 u32 ntr_enable

/
 u32  frame_index; /* current microframe number */
 /* CTRLDSSEGMENT: offset 0x10 */: offset */
 3  ; /* address bits 63:32 if needed */
 /* PERIODICLISTBASE: offset 0x14 */
 u32;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 /* ASYNCLISTADDR: offset 0x18 */
u2 ; /* address of next async queue head */

 u32/* the rest is HCD-private */

 /* CONFIGFLAG: offset 0x40 */
 u32  configured_flag;
# FLAG_CF(<) /* true: we'll support "high speed" */

java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 u32  port_status[]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* 31:23 reserved */  ;
 *
(<)/
#define PORT_WKCONN_E (1<<20
/* 19:16 for port testing */
define01java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
#define
#define  <)
#define PORT_LED_MASK (3<<14)
 (<3 *:    thisjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
#define PORT_POWER (1<<12)  /* true: has power (see PPC) */
#define PORT_USB11 (dma cpu_to_le32()dma)0)|_)
/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
/* 9 reserved */
#define PORT_RESET (1<<8java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define PORT_SUSPEND   That's dictated by the hardware; a type tag is
#define PORT_RESUME (1<<6)  /* resume it */ * Q_NEXT_TYPE to get *
#define union {
define  14 /
#define PORT_PEC (1<<3)  ) java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37
#define PORT_PE  
  
  1 *  *java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
   ( |  )
} __packedx00008000

#define QTD_NEXT(dma) cpu_to_le32((u32)dma)

/*
 * EHCI Specification 0.95 Section 3.5
 * QTD: describe data transfer components (buffer, direction, ...)
 * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram".
 *
 * These are associated only with "QH" (Queue Head) structures,
 * used with control, bulk, and interrupt transfers.
 */

struct ehci_qtd {
 /* first part defined by EHCI spec */
_le32; /* see EHCI 3.5.1 */
 __le32   hw_alt_next;  /* see EHCI 3.5.2 */
 __le32   hw_token;  /* see EHCI 3.5.3 */_   w_qtd_next
#defineQTD_TOGGLE(1< 1) /* data toggle */
#defineQTD_LENGTH) ((()>16)&x7fff
#define  _   hw_buf[5;
#define QTD_CERR(tok) (((tok)>>10) & 0x3_le32 hw_buf_hi];
#define 
#define QTD_STS_ACTIVE (1 << 7) /* HC may execute this */

#define QTD_STS_HALT (1 << 6) /* halted on error */
#define QTD_STS_DBE (1 << 5) /* data buffer error (in HC) */
#define
define (1 <3
#define QTD_STS_MMF (1 << 2) /* incomplete split transaction */

  kref;
#define QTD_STS_PINGunsigned   ;
 __le32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 __   hw_buf_hi[] /

 /* the rest is HCD-private */
   ;  /* qtd address */
 struct list_head qtd_list;  /* sw qtd list */
  urb *rb;   /* qtd's urb */
 size_t   length#define QH_STATE_UNLINK_WAITjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 u32  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 void   *buffer;
 dma_addr_t  buffer_dmaandwidth*/
 void   *transfer_buffer u8   gap_uf  /* uframes split/csplit gap */
 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 22
} __aligned(32);

/* mask NakCnt+T in qh->hw_alt_next */
#defineQTD_MASK (~x1f

#define IS_SHORT_READ(tokenunsignedshort  start;  /* where polling starts */

/* Type tag from {qh, itd, sitd, fstn}->hw_next */
#define Q_NEXT_TYPE(dma) ((dma) & cpu_to_le32 (3 << 1))

/* values for that type tag */
#define Q_TYPE_QH cpu_to_le32 (1 << 1)

/* next async queue entry, or pointer to interrupt/periodic QH */
#define QH_NEXT(dma) (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH)

/* for periodic/async schedules and qtd lists, mark end of list */
#define EHCI_LIST_END cpu_to_le321 /* "null pointer" to hw */

/*
 * Entries in periodic shadow table are pointers to one of four kinds
 * of data structure.  That's dictated by the hardware; a type tag is
 * encoded in the low bits of the hardware's periodic schedule.  Use
 * Q_NEXT_TYPE to get the tag.
 *
 * For entries in the async schedule, the type tag always says "qh".
 */

union OXU_SPH_CORE_OFFSETx00800
 struct  *qh  /* Q_TYPE_QH */
 __le32   *hw_next; /* (all types) */
 void   *ptr;
};

/*
 * EHCI Specification 0.95 Section 3.6
 * QH: describes control/bulk/interrupt endpoints
 * See Fig 3-7 "Queue Head Structure Layout".
 *
 * These appear in both the async and (for interrupt) periodic schedules.
 */


struct java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
 /* first part defined by EHCI spec */
 __le32   hw_next;  /* see EHCI 3.6.1 */ size= 8kbytes/
 __le32 #defineQHEAD_NUM6
#defineQTD_NUM 32
  hw_info2;/* see EHCI 3.6.2 */
##define MURB_NUM  8
#define#define BUFFER_NUM  8
#define QH_HUBADDRstruct oxu_info {
#define QH_HUBPORT
u8} __aligned(BUFFER_SIZE);
 __le32 struct oxu_onchip_mem {

 /* qtd overlay (hardware parts of a struct ehci_qtd) */ struct struct ehci_qtd  } __aligned(4 << java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 __le32   struct
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 __le32   hw_token;
_le32 hw_buf[5]
 __le32   hw_buf_hi[5];

 /* the rest is HCD-private */
  u8 qh_usedQHEAD_NUMjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 union ehci_shadowu8 db_used[]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 struct
 struct  *;
  mem_lock

    *;
 struct kref  kref
unsignedjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

 u8   qh_state  lock
java.lang.NullPointerException
#define QH_STATE_UNLINK ehci_qh*;
#define QH_STATE_IDLE   struct ehci_qh  *reclaim;
#define QH_STATE_UNLINK_WAIT 4  /* LINKED and on reclaim q */
#define QH_STATE_COMPLETING 5  /* don't touch token.HALT */

 /* periodic schedule info */
 u8  usecs  /* intr bandwidth */
 u8   gap_uf;  /* uframes split/csplit gap */
 u8 ; /* ... split completion bw */
/* tt downstream bandwidth */
unsignedshort  period;  /* polling interval */
 unsigned  start /* where polling starts */
#define NO_FRAME  int i_thresh /* uframes HC might cache */
 struct *dev  /* access to TT */
} __(32;

/*
 * Proper OXU210HP structs
 */


#define OXU_OTG_CORE_OFFSET 0x00400
#define OXU_OTG_CAP_OFFSET   int ; /* periodic activity count */
#define OXU_SPH_CORE_OFFSET 0x00800
#define OXU_SPH_CAP_OFFSET(OXU_SPH_CORE_OFFSET+0x100

#define OXU_OTG_MEM  0xE000
#define OXU_SPH_MEM  0x16000

/* Only how many elements & element structure are specifies here. */
/* 2 host controllers are enabled - total size <= 28 kbytes */
#define DEFAULT_I_TDPS  1024
#define QHEAD_NUM  16
#define QTD_NUM   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define SITD_NUM  8
#  

#define  struct timer_list;
#define  unsigned longactions;

struct oxu_info {
 struct usb_hcd *hcd[2];
};

struct oxu_buf {
 u8bufferBUFFER_SIZE]
} __aligned(BUFFER_SIZE);

struct oxu_onchip_mem {
 struct oxu_buf  db_pool[BUFFER_NUM];

 u32   frame_list[DEFAULT_I_TDPS];
 struct ehci_qhjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ehci_qtd[QTD_NUM;
} __aligned(4 << 10);

#define EHCI_MAX_ROOT_PORTS 15  /* see HCS_N_PORTS */

struct oxu_murb{
 struct urb  java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 9
 struct urb  *main;
 u8   last;
};

struct oxu_hcd {    /* one per controller */
 unsigned ;  /* packed release number */

 u8   qh_used
 u8[QTD_NUM
 u8db_used];
 u8 #efine EHCI_ASYNC_JIFFIES(/20)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

 struct


   ;

  _ *;
TIMER_ASYNC_SHRINK

    cs_params
 spinlock_t  lock;

 /* async schedule support */
 * Main defines
 struct ehci_qh  *reclaim;
  int reclaim_ready1
 unsigned int  scanning:1;

 /* periodic schedule support */
 unsigned int  periodic_size;
 __le32   *periodic; /* hw periodic table */
 dma_addr_t eriodic_dma
 unsigned dev_err((oxu->.controller, , ##args

 union ehci_shadowpshadow/* mirror hw periodic table */
 int   next_uframe; dev_info(oxu-selfcontroller fmt , ##args
 unsignedint  ; /* periodic activity count */

 /* per root hub port */
 unsigned long  reset_done[EHCI_MAX_ROOT_PORTS];
 /* bit vectors (one bit per port) */
 unsigned long  bus_suspended; /* which ports were}
 * already suspended at the
 * start of a bus suspend
 */

 unsigned long  companion_ports;/* which ports are dedicated
 * to the companion controller
 */


 struct timer_list watchdog
  long actions
 unsigned intundefjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 unsigned long  next_statechange;#efine xu_vdbg, fmtargs..)/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 u32   command;

 /* SILICON QUIRKS */
dbg_status_buf *, unsignedconst *, u32)
       *{
       * resources
       */
 struct oxu_murb  *murb_pool; /* murb per split big urb */ scnprintfbuf len"% %0x%s%%s%%s%%%%s"
 unsigned  urb_len

  ( & STS_ASS) ? " Async" :"",
};

#define EHCI_IAA_JIFFIES (HZ/100) /* arbitrary; ~10 msec */
#efine EHCI_IO_JIFFIES (HZ10) /* io watchdog > irq_thresh */
#define EHCI_ASYNC_JIFFIES      (HZ/20)  /* async idle timeout */
#define EHCI_SHRINK_JIFFIES(HZ20) /* async qh unlink delay */

enum ehci_timer_action {
 ( & STS_HALT) ?" Halt" : ",
 TIMER_IAA_WATCHDOG,
 TIMER_ASYNC_SHRINK (status & STS_FATAL ?"FATAL : "",
TIMER_ASYNC_OFF,
};

/*
 * Main defines
 */


#define  statusSTS_PCD) ? "PCD" : ",
 (oxu_to_hcd)->self , fmt ##args
#define ( & STS_INT?   "
 dev_err(oxu-.controller ,fmt )
#define oxu_info
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

#ifdef CONFIG_DYNAMIC_DEBUGdbg_intr_bufcharbuf,unsigned,  char*abel enable
 scnprintf, , %% %2%%%%s%ss,
#endif

static inline struct usb_hcd *oxu_to_hcd(struct oxu_hcd *oxu)
{
  label[0   ":" ,
}

static inline struct oxu_hcd *hcd_to_oxu(struct usb_hcd *hcd)
{
  (enable & ) ? " FATAL : ",
}

/*
 * Debug stuff
 */


#undef  (enable STS_PCD) ?"PCD : ""
#undef  (enable &STS_ERR?"ERR : ",

#ifdef OXU_VERBOSE_DEBUG
#define oxu_vdbg   oxu_dbg
#else
#define oxu_vdbg(oxu, fmt, args...)  );
#endif

#ifdef DEBUG

static int __attribute__((__unused__
dbg_status_bufchar*, unsignedlen constchar label, u32status)
{
 return scnprintf(buf, len, "%s%sstatus %04x const char *label,u32 command)
  label, label[0] ? " " : "", status,
  (status & STS_ASS) ? " Async" : "",
s  STS_PSS "Periodic :""
  (status &  "s%scommand%0x %s=d ithresh=dssssperiod%s% s,
  (status & STS_HALT) ? " Halt" : "",
  ( & STS_IAA   " ",
  (status & STS_FATAL) ? " FATAL" : "",
  status )? FLR: ",
  (status & STS_PCD) ? " PCD" : "",
  (status  command> 6 &0,
  (status( &CMD_LRESET?"LReset ""java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  );
}

static  __ttribute__((_))
dbg_intr_buf(char *buf( &)   ":",
java.lang.StringIndexOutOfBoundsException: Range [20, 1) out of bounds for length 1
returnscnprintf,len%% 0xssssss",
  label, java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 11
 (enable & STS_IAA?  IAA "java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 ( & STS_FATAL?" FATAL"  ""
  (enable  ;
  case <1java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  (enable & STS_ERR;
 enable ) ? INT "
  );
}

static const char    = ""
java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 35

static  (charbufunsigned len,
    const char *label, u32 command)
{
 returnscnprintf, len
  %% 0x%=dithreshds%sssperiods %"
  "ssport% %6%% sig%s%%%%%%%sss,
  (command & CMD_PARK) ? "park" : "(park)",
 CMD_PARK_CNTcommand
   ( & )  " "
  (command( &PORT_OWNER " OWNER :",
  (command & CMD_IAAD) ? " IAAD" : "",
  (command statusPORT_RESET?"RESET :",
  (command & CMD_PSE) ? " Periodic" : "",

  (command & CMD_RESET status ) ?"RESUME":""
  (command CMD_RUN  RUN:"HALT"
  );
}

static int(char*buf  lenconst  *,
    int port(tatus&PORT_PEC)?"PEC "java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
{
  *;

/
 switch (status)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  s
  break  0 }
 case 1 << 10:
  sig = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ;
 case 2 << 10:
  = j;
  break;
 default:
  sig = "
 ;
 }

 returnreturn;}
  "%s%sport %d status %06x
  label  int_((_))
  (status(charbuf , , u32)
  (status & PORT_OWNER) ? " OWNER" : "",
  sigendif/* DEBUG */
  (status
  (status&PORT_SUSPEND?"SUSPEND "java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  (status & PORT_RESUME) ? " charbuf80;\
  (status & PORT_OCC) ? " OCC dbg_status_buf(_, sizeof _,label,status);\
  (status & PORT_OC) ? " OC" : "",
  (status & PORT_PEC) ? " PEC" : "",
  (status & define(, , command  \
  ( & PORT_CSC ?"CSC "java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 s & ) ?"CONNECT" :"
     );
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

else

static inline int __attribute__((__unused__))
( *, nsigned,  char,  status)
return 0; }

static int_((_))
dbg_command_buf
return 0; }

static inline int 
dbg_intr_buf(char *buf, unsigned/* Initial IRQ latency: faster th java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
return 0; }

staticMODULE_PARM_DESC, log2 latency- "
dbg_port_buf(char /java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
return 0; }

endif

/* functions have the "wrong" filename when they're output... */,park -3back-to-back )java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
#define dbg_status bool;
charbuf] \
 dbg_status_buf(ignore_oc" bogus hardware overcurrentindications");
 oxu_dbg(oxu, "
}

#define dbg_cmd(oxu, label,staticint(struct *hcd
 char_[8] 
  char,u6wLength)
 oxu_dbg
}

#define dbg_port(
 char _buf[80]; \
 dbg_port_bufbufsizeof_uf , , statusjava.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
 oxu_dbg(oxu, "%s\n", _
}

/*
 * Module parameters
 */


/* Initial IRQ latency: faster than hw default */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
module_paramlog2_irq_thresh,intS_IRUGO
MODULE_PARM_DESC(log2_irq_thresh, "log2 IRQ latency, enum ehci_timer_actionaction)

/* Initial park setting: slower than hw default */
static unsigned park;
module_param(park, uint
(parkpark;13back-to-back "

/* For flakey hardware, ignore overcurrent indicators */
static bool ignore_oc;
module_param(ignore_oc, bool, S_IRUGO);
MODULE_PARM_DESC(ignore_oc, "ignore bogus hardware overcurrent indications");


static
 * handshake - spin reading hc until handshake  * @ptr: address of hc register to be read * @mask: bits to look at in result of * @done: value of those bits when handshake  * @usec: timeout in microseconds
    u16 typeReq, * handshake done).  There are two failure modes * hardware flakeout), or the register reads as all-ones *
   * before driver shutdown. But it also seems to * bridge shutdown:  shutting down the bridge before the 

/*
 * Local functions
 */


/* Low level read/write registers functions */
static inline u32 oxu_readl(void __iomem{
{
 return readl(base + reg);
}

static inline  (result) =done|
{
 writel(val, base + reg);
}

static inline void if = ) 
enum ehci_timer_action action)
{
clear_bit(action, &oxu->actions);
}

static inline void timer_action(struct oxu_hcd *oxu,
enum ehci_timer_action action)
{
if (!test_and_set_bit(action, &oxu->actions)) {
unsigned long t;

switch (action) {
case TIMER_IAA_WATCHDOG:
t = EHCI_IAA_JIFFIES;
break;
case TIMER_IO_WATCHDOG:
t = EHCI_IO_JIFFIES;
break;
case TIMER_ASYNC_OFF:
t = EHCI_ASYNC_JIFFIES;
break;
case TIMER_ASYNC_SHRINK:
default:
t = EHCI_SHRINK_JIFFIES;
break;
}
t += jiffies;
/* all timings except IAA watchdog can be overridden.
 * async queue SHRINK often precedes IAA.  while it's ready
 * to go OFF neither can matter, and afterwards the IO
 * watchdog stops unless there's still periodic traffic.
 */

 
    && t >static di_reseto *)
    && timer_pending _iomemreg_ptr
  ;
  mod_timer(&oxu->watchdog =( _iomem(( _ *oxu-)  x68
 tmp x3
}

/*
 * handshake - spin reading hc until handshake completes or fails
 * @ptr: address of hc register to be read
 * @mask: bits to look at in result of read
 * @done: value of those bits when handshake succeeds
 * @usec: timeout in microseconds
 *
 * Returns negative errno, or zero on success
 *
 * Success happens when the "mask" bits have the specified value (hardware
 * handshake done).  There are two failure modes:  "usec" have passed (major
 * hardware flakeout), or the register reads as all-ones (hardware removed).
 *
 * That last failure should_only happen in cases like physical cardbus eject
 * before driver shutdown. But it also seems to be caused by bugs in cardbus
 * bridge shutdown:  shutting down the bridge before the devices using it.
 */

 ;
     u32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
   for  /  take*
  ;

  (ptr,
   , 6*5 =){
      result == U32_MAX),
     1, usec()-state ;
if = ) /
  return -ENODEV;

 
}

/* Force HC to halt state from unknown (EHCI spec section 2.3) */
  (struct oxu
{
 (temp>regs-);

  /* hardware can take 16 microframes to turn off ... */
 writel0,&>regs->);

 ( & )!0
  return 0;

  =(&>regs-)
 temp
 writel(temp
r handshake,&oxu->,
   , , 6*2)
}

/* Put TDI/ARC silicon into EHCI mode */
  ( *java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
{
 u32 __iomem *reg_ptr;
u32tmp;

 reg_ptr = (u32 __iomem *)(((u8 __iomem *)oxu->regs) + 0x68);
 tmp = readl(reg_ptr return;
 tmp java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 writel(tmp, reg_ptr);
}

/* Reset a non-running (STS_HALT == 1) controller */
 intehci_reset( oxu_hcdoxu
{
  truct *desc
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 command |= CMD_RESET;  temp
 dbg_cmd
writel, &>regs-command
 oxu_to_hcddesc- = 0 /* oxu 1.0, 2.3.9 says 20ms max */
 oxu->next_statechange = desc-> = ;
 retval = handshake desc- =ports
     CMD_RESET 0 5 * 10)

 if)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

memset>uhs[0,0 );

return;
}

/* Idle the controller (from running) */
 void(structoxu_hcd)
{
u32;

#ifdef  temp= HUB_CHAR_NO_LPSM/* no power switching */
BUG_ONHC_IS_RUNNING((oxu>));
endif

 /* wait for any schedule enables/disables to take effect */
 temp =readl&oxu->)< 0
 temp &= STS_ASS | STS_PSS;
 if (handshake * An on-chip memory data buffer is required for each OXU210HP USB * Each transfer descriptor has one or more on-chip memory *
    temp, 16 * * data buffers are allocated with sizes the power of 2 multiples * the block size, starting on an address a multiple of the allocated *
  oxu_to_hcd(oxu)->state = HC_STATE_HALT;
  return;
 }

 /* then disable anything that's still active */
 temp = readl(&oxu->regs->command);
 temp &= ~(CMD_ASE n_blocks;/* minium blocks needed to hold len */
 writel(temp, &oxu->regs->command)inti ;

 /* hardware can take 16 microframes to turn off ... */
 if /* Don't allocate bigger than supported */
    ,1  15 =0 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 return-;
  return;
}
}

static =len    ;
    u32 _ Round   up  powerjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{
 if ( * Find a suitable available data buffer */
 >[index 0
  return port_status;
 }

 * if reset finished and it's still not enabled -- handoff */
 if (!(port_status if(>db_used+)
  oxu_dbg(oxu, "Failedjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 10
  ;
  return port_status;
 } else
  oxu_dbgqtd- =void oxu->db_pool;

 return port_status;
}

static void  qtd->qtd_buffer_len = BUFFER_SIZE
    struct usb_hub_descriptor *desc
{
 int ports = HCS_N_PORTS(oxu- 0;
 u16 temp;

 desc->bDescriptorType java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 0
 >bPwrOn2PwrGood 1 /* oxu 1.0, 2.3.9 says 20ms max */
 desc->bHubContrCurrent = 0;

 desc->static void oxu_buf_free(struct oxu_hcd *oxu, struct ehci_qtd *qtd)
 temp = 1 + (ports /  int index
 desc->spin_lock>);

 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */ =qtd- -void oxu->>db_pool[]
 memset(&desc->oxu->[index= ;
 qtd-qtd_buffer_len;

 temp = HUB_CHAR_INDV_PORT_OCPM; >buffer = ;
 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 else
  temp |= HUB_CHAR_NO_LPSM; /* no power switching */
 desc-wHubCharacteristics = (_forceu16(temp
}


/* Allocate an OXU210HP on-chip memory data buffer
 *
 * An on-chip memory data buffer is required for each OXU210HP USB transfer.
 * Each transfer descriptor has one or more on-chip memory data buffers.
 *
 * Data buffers are allocated from a fix sized pool of data blocks.
 * To minimise fragmentation and give reasonable memory utlisation,
 * data buffers are allocated with sizes the power of 2 multiples of
 * the block size, starting on an address a multiple of the allocated size.
 *
 * FIXME: callers of this function require a buffer to be allocated for
 * len=0. This is a waste of on-chip memory and should be fix. Then this
 * function should be changed to not allocate a buffer for len=0.
 */

static int(m);
{
 int n_blocks;s struct *(struct
 intjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 int  (  ;i<; +)

 /* Don't allocate bigger than supported */
 if (len > BUFFER_SIZE *  break;
  oxu_err(oxu, "buffer too ( < QTD_NUM {
  return -ENOMEM;
}

 spin_lock(&oxu-> memset(, , sizeof *td

 ofblocks tohold *java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 n_blocks INIT_LIST_HEAD>qtd_listjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

 /* Round the number of blocks up to the power of 2 */
fora_blocks ;a_blocks ; a_blocks< 1
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 /* Find a suitable available data buffer */
 for (i = 0; i}
   i += max_t(int, a_blocks, oxu->db_used[i]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  /* Check all the required blocks are available */
  for (j = 0; j < a_blocks
   if (oxu->db_used[i +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    break;

  if (j 
   continue;

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  qtd->buffer void(struct *kref
  qtd->buffer_dma = virt_to_phys ehci_qhqh (kref struct, kref

  qtd->qtd_buffer_len = BUFFER_SIZE * a_blocks;
  oxu->db_used[

  spin_unlock(&oxu->mem_lock);

  return 0;
}

 /* Failed */

 spin_unlock(&oxu->mem_lock); oxu_qtd_free(,>dummy

 return -ENOMEM;
}

static oxu_buf_free oxu_hcdoxu ehci_qtdqtd
{
 int index;

 spin_lock(&oxu->mem_lock);

 index =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 oxu-[index 0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 qtd->qtd_buffer_len = 0;
 qtd->buffer_dma
q>buffer;

spin_unlock>mem_lock
}

static inline void ehci_qtd_init(struct java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 23
{
memset,0 *);
 qtd->qtd_dma = dma
 qtd->hw_token qh->ummyehci_qtd_allocoxu
 qtd-> =;
 qtd- (oxu" \)
INIT_LIST_HEAD>qtd_list
}

static inline void oxu_qtd_free( }
{
 ;

 if (qtd-:
  oxu_buf_free( (&oxu-);

 spin_lock(&oxu->mem_lock);

 index =
 oxu->qtd_used[index] = 0;

 spin_unlock(&oxu->mem_lock);
}

static struct ehci_qtd *ehci_qtd_alloc
{
 int i;
 struct ehci_qtd *qtdkref_put>kref);

 spin_lock(&oxu->mem_lock  oxu_murb_free  *,  oxu_murb)

 for (intindexjava.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
  if(oxu-[i)
    oxu->mu]  ;

ii )
   qtd
  memset(qtd,  struct *(struct *)

  qtd->hw_token  ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 > = ;
  qtd-
INIT_LIST_HEAD>qtd_listjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

  qtd->qtd_dma =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  oxu->qtd_used[i] = 1;
 }

 spin_unlock(&oxu->mem_lock);

 return qtd;
}

static void oxu_qh_free(  murb;
{
 int index;

 spin_lock(&oxu->mem_lock);

 index = qh - &oxu->mem->qh_pool[0];
 oxu->qh_used[ci_mem_cleanup( oxu_hcdoxu

 spin_unlock>mem_lock
}

static void qh_destroy(struct kref *kref)
{
 struct ehci_qh *qh = container_of(kref, struct ehci_qh, kref);
  oxu-periodic= NULL

 /* clean qtds first, and know this is not linked */>);
 if (!list_empty(&qh->qtd_list) || qh->qh_next.ptr) {
 oxu_dbgoxu" qh notempty!\";
  BUG();
 }
 f(>dummy
  oxu_qtd_free
 oxu_qh_free(oxu, qhjava.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
}

static struct
{
 int 
 for  0<>; +)

spin_lock>);

 for (i = 0; i < QHEAD_NUM; i++)
  if (!oxu->qh_used[i])
   break;

 ifi<QHEAD_NUM){
  qh = (struct ehci_qh *) &oxu->mem->qh_pool[i];
  memsetg fail

    i=0   MURB_NUM i+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  qh->oxu = oxu;
 qh->qh_dma  virt_to_phys(qh
  INIT_LIST_HEAD(&qh->qtd_list) if!>async

  /* dummy td enables safe urb queuing */
 > =ehci_qtd_alloc);
  if (qh-oxu- = virt_to_phys(>periodic
   oxu_dbg(oxu, "no dummy tdfor( ;i< oxu->periodic_size +)
   oxu->qh_used[i] = 0;
  oxu-periodic]=EHCI_LIST_END
   goto unlock;
  }

  oxu->qh_used[i] = 1;
 }
:
 spin_unlock(&oxu-r 0;

 return qh;
}

/* to share a qh (cpu threads, or hc) */
tatic struct *(structehci_qh *)
{
 kref_get(&qh->kref);
 return qh;
}

static inline void qh_put   tokenmaxpacket
{
 kref_put(&qh->kref, qh_destroy);
}

static void  perK.  might short unaligned/
{
 int index;

 spin_lock(&oxu->mem_lock);

 index = murb - &oxu->murb_pool[0];
 oxu->murb_used[index] = 0 qtd-hw_buf_hi] ((3( > 2);

 spin_unlock(if likely < ))  /* ... iff needed */
}

static struct +  000java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

{
 int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 struct oxu_murb >hw_buf_hi]=(()(ddr >3);

 spin_lock(&oxu->mem_lock);

 for ( if(( + 0) < )
  if(oxu-murb_used[]java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    count lenjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

 if (i < MURB_NUM) {
 murb =&o>murb_pooli;

 oxu-murb_used[]=1
 }

 spin_unlock(&oxu->>length;

 return murb;
}

/* The queue heads and transfer descriptors are managed from pools tied
 * to each of the "per device" structures.
 * This is the initialisation and cleanup code.
 */

static void ehci_mem_cleanup(struct
{
(murb_pool
 oxu->murb_pool =  > =qtd-

 if (
  qh_put(oxu-)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 oxu->async = NULL;

 timer_delete(&oxu-

 oxu->periodic = NULL;

 /* shadow periodic table */
 kfree(oxu->pshadow);
> ;
}

/* Remember to add cleanup code (above) if you add anything here.
 */

int(  *,  flags
{
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 for (i = 0; i < oxu- wmb();
  oxu->mem->frame_list[i] = EHCI_LIST_END;
for( = 0 i<QHEAD_NUMi+
  oxu->qh_used[i] = 0;
 for (java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
  oxu->qtd_used[i] = 0;

 oxu->murb_pool = kcalloc(MURB_NUM, sizeof(struct oxu_murb), flags 
 if!xu-)
  goto fail;

  (i=0   MURB_NUM+)
  oxu->murb_used[i] = 0;

 oxu->async =
 ififlist_emptyqh-qtd_list
  goto fail;

 oxu-list_entryqh-.next
 oxu->periodic_dma   struct, qtd_list

 for (i = 0; i < oxu->periodic_size; i++)
  oxu->periodic[i] = EHCI_LIST_END;

 /* software shadow of hardware table */
 oxu- = (oxu-periodic_size, sizeofvoid),);
   (oxu , qtd
  return 0;

fail:
 oxu_dbg,"' \n);
 ehci_mem_cleanup(oxu);
eturnENOMEM
}

/* Fill a qtd, returning how much of the buffer we were able to queue up.
 */

static   >actual_length+= - QTD_LENGTH);
    int
{
 nt, count
u64 addrbuf

 /* one buffer entry per 4K ... first might be short or unaligned */
 qtd->hw_buf[0] = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 qtd->hw_buf_hi[0]  & 
 =x1000  x0fff/
 if (likely
  count = len;
 else {
 buf +  000
  buf &= ~0x0fff;

  urb-status-;
  for     (oken  ) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  addrbuf
   qtd->hw_buf[i]  :ECOMM
qtd->hw_buf_hi[i] = cpu_to_le32((u32)(addr >> 32));
buf += 0x1000;
if ((count + 0x1000) < len)
count += 0x1000;
else
count = len;
}

/* short packets may only terminate transfers */

 fcount len
   count -=    (urb-),
 }
qtd- =cpu_to_le32( <1)|token
 qtd->length = count;

 return count;
}

static inline void qh_update(struct oxu_hcd *oxu,
    struct ehci_qh * urb-status=-;
{
 /* writes to an active overlay are unsafe */
 java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0

 qh->hw_qtd_next = QTD_NEXT(qtd->qtd_dma);
  usb_pipedevice>pipe,

 /* Except for control endpoints, we make hardware maintain data
 * toggle (like OHCI) ... here (re)initialize the toggle in the QH,
 * and set the pseudo-toggle in udev. Only usb_clear_halt() will
 * ever clear it.
 */

 if (!(qh->hw_info1 & cpu_to_le32(1 << 14))) {
  unsigned is_out, epnum;

  is_out = !(qtd->hw_token & cpu_to_le32(1 <static voidehci_urb_donestruct oxu_hcd oxustructurb *urb)
  epnum = (le32_to_cpup(&qh->hw_info1) >> 8) __acquiresoxu->lock
  if (unlikely(!usb_gettoggle(qh->dev, epnum, if (likely>hcpriv! )) {
   qh->hw_token &= ~cpu_to_le32(QTD_TOGGLE);
   usb_settoggle(qh->dev, epnum  structehci_qh *h =( ehci_qh)urb-;
  }
 }

 /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */
 wmb();
 qh-
}

/* If it weren't for a common silicon quirk (writing the dummy into the qh
 * overlay, so qh->hw_token wrongly becomes inactive/halted), only fault
 * recovery (including urb dequeue) would need software changes to a QH...
 */

staticvoidqh_refresh
{
   *;

 if (list_empty(&qh->qtd_list))
  qtd=qh-dummy;
 else {
xt,
    struct ehci_qtd,  urb->status  0
  /* first qtd may already be partially processed */
  if (cpu_to_le32(qtd->qtd_dma) == qh->hw_current)
   qtd = NULL;
 }

ifqtd
 qh_update(, qh,qtd;
}

static void qtd_copy_status(struct java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 34
    size_t length, u32 token)
{
 /* count IN/OUT bytes, not SETUP (even short packets) */
 if (likely(QTD_PID( oxu_dbg, " surb% ep%d% status %d len %d/%\",
  urb- _func__, >dev-devpathurb

 /* don't modify error codes */
 if  usb_pipein(>pipe "" : "",
  return;

 /* force cleanup after short read; not always an error */
 if (unlikely(IS_SHORT_READ(token)))
  urb->status = -EREMOTEIO;

ts reported bythe hardware*/
 ifspin_lock&>lock;
  if (token & QTD_STS_BABBLE) {
   /* FIXME "must" disable babbling device's port too */
   urb->status = -EOVERFLOW;
  } else if (tokenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  /* fs/ls interrupt xfer missed the complete-split */
   urb->status = -EPROTO;
  } else if (token & QTD_STS_DBE) {
  urb- = (QTD_PIDtoken) = 1 /* IN ? */
    ? -ENOSR  /* hc couldn't read data */
    : -ECOMM; /* hc couldn't write data */
  } java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tried*/
   if (QTD_CERR(token))
    urb->status =static qh_schedule oxu_hcd  ehci_qh;
   else {
    oxu_dbg#defineHALT_BITcpu_to_le32(QTD_STS_HALT
     urb->dev->devpath,
     usb_pipeendpoint(urb->pipe),
     usb_pipein(urb->pipe) ?  * Chases up to qh->hw_current.  Returns number of completions called,
    urb->status *

  /* CERR nonzero + no errors + halt --> stall */
   if())
   urb->status = -EPIPE;
 
   urb->  stopped

  i do_status 0
  usb_pipedevice(urb->pipe),
   usb_pipeendpoint(urb->pipe),
   usb_pipein(urb->pipe) ? "in"  structoxu_murbmurb ;
   token, urb->(&qh-)))
 }
}

static void ehci_urb_done(struct oxu_hcd  * till we've gone through and cleaned everything up, even when
__releases  * NOTE:  unlinking expects to be done in queue order.
__ state >qh_state
{
  (likely>hcpriv=NULL
  struct ehci_qh *qhstopped=( == QH_STATE_IDLE;

  /* S-mask in a QH means it's an interrupt urb */
  if ((qh->hw_info2 & cpu_to_le32(QH_SMASK)) != 0) { * then let the queue advance.

   /* ... update hc-wide periodic stats (for usbfs) */
  oxu_to_hcdoxu)-selfbandwidth_int_reqs--;
  }
  qh_put(qh);
 }

 urb->hcpriv = NULL;
 switch (urb->status) {
 case -EINPROGRESS:  /* success */
 rb-status = 0
  break;
 default:   /* fault */
  break;
 case -EREMOTEIO:  /* fault or normal */
  if (!(urb->transfer_flags  iflast->complete=NULL{
   urb->status= 0;
  break;
 case -:  /* canceled */
 case -ENOENT
  break;
 }

OXU_URB_TRACE
 oxu_dbg(oxu, "%s %s urb %p ep%d%s status %d len %d/%d\n",
  __func__} {
 (urb-pipe
  usb_pipein(urb->pipe) ? "in" : "out",
       count+
  urb->actual_length, urb->transfer_buffer_length);
#endif

 /* complete() can reenter this HCD */  oxu_qtd_free(, last
 spin_unlock(&oxu-> java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 usb_hcd_giveback_urb(  (qtd==end)
 spin_lock(&   break
}

static void start_unlink_async(struct oxu_hcd *oxu, struct ehci_qh *qh);
static  unlink_async( oxu_hcdoxu struct *h);

static void /* always clean up qtds the hc de-activated */
static int qh_schedule(struct oxu_hcd *oxu, struct

#define  stopped ;

/* Process and free completed qtds for a qh, returning URBs to drivers.
 * Chases up to qh->hw_current.  Returns number of completions called,
 * indicating how much "real" work we did.
 */

static  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
struct  *last =NULL end qh-;
 struct ehci_qtd *qtd, *tmp;
 int stopped;
 unsigned count = 0 }
 int  /* stop scanning when we reach qtds the hc is using */
 u8 state;
 struct oxu_murb   elseif ((!stopped&

 if (unlikely(list_empty(&qh->qtd_list)  HC_IS_RUNNINGoxu_to_hcd(oxu)>))) {
   count

 /* completions (or tasks on other cpus) must never clobber HALT 
 * till we've gone through and cleaned everything up, even when
 * they add urbs to this qh's queue or mark them for unlinking.
 *
 * NOTE:  unlinking expects to be done in queue order.
 */

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 qh-    * for the urb faulted (including short read) or
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* remove de-activated QTDs from front of queue.
 * after faults (including short reads), cleanup this urb
 * then let the queue advance.
 * if queue is stopped, handles unlinks.
 */

 list_for_each_entry_safe(qtd, tmp, &qh->qtd_list, qtd_list) {
   urb*;
  u32 token = 0;

  urb = qtd->urb;

  /* Clean up any state from previous QTD ...*/
 if (lastjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
   (likely>urb != urb {
    if (last-   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    = ( oxu_murb)last-urb
     last->urb = murb- if(tate=QH_STATE_IDLE
   if(urb->last{
      ehci_urb_done(oxu)   == >hw_current
      ++;
     }
     oxu_murb_free /* force halt for unlinked or blocked qh, so we'll
} else {
ehci_urb_done(oxu, last->urb);
count++;
}
}
oxu_qtd_free(oxu, last);
last = NULL;
}

/* ignore urbs submitted during completions we reported */

  if (qtd == end)
   break;

  /* hardware copies qtd out of qh overlay */
  rmb();
  token = le32_to_cpu(qtd->hw_token);

  /* always clean up qtds the hc de-activated */
  if ((token & QTD_STS_ACTIVE) == 0) {

   if ((token & QTD_STS_HALT) != 0) {
  =

  /
    * that silicon quirk can kick in with this dummy too.
    */
   } else if (IS_SHORT_READ    && usb_pipecontrol(urb->pipe);
     !(qtd->hw_alt_next & EHCI_LIST_END)) {
    stopped = 1;
    goto halt;
   }

  /* stop scanning when we reach qtds the hc is using */
  } else if (likely(!stopped &&
    HC_IS_RUNNING(oxu_to_hcd(oxu)->state))) {
   break;

  } else{
   stopped = 1;

   if (unlikely  murb = ( oxu_murb* last->urbjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    >status=-ESHUTDOWN

s unless previous
    * for the urb   c++;
    * its urb was canceled.  we   oxu_murb_free, murb;
    */
   ((urb- == EINPROGRESS
    continue;

   /* issue status after short control reads */
   if (unlikely(do_status != 0}
     && QTD_PID( /* restore original state; caller must unlink or relink */
    do_status = 0;
    continue;
   }

   /* token in overlay may be most current */  * it after fault cleanup, or recovering from silicon wrongly
   if (state == QH_STATE_IDLE
     && cpu_to_le32(qtd->qtd_dma)
      == qh->hw_current)
    token = le32_to_cpu(qh->hw_token (statejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18

 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    * patch the qh later and so    * except maybe high bandwidth ...
    * activate it while if (cpu_to_le32QH_SMASK)
    *
   if (( intr_desched(oxu);
halt voidqh_scheduleoxu,qh
    qh->hw_token } 
    wmb();
   }
  }  break;

  /* Remove it from the queue */
  qtd_copy_status(oxu, urb->complete ?
     urb : ((java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
    qtd->length, token);
  if ((usb_pipein(qtd->urb->pipejava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
   NULL! >transfer_buffer
   memcpy(qtd->transfer_buffer/* ... and packet size, for any kind of endpoint descriptor */
  do_status = (urb->status == -#definemax_packet(MaxPacketSize (wMaxPacketSize) & 0x07ff)
    && usb_pipecontrol(urb->pipe);

  if (stopped && qtd->qtd_list.
   last = list_entry(qtd->qtd_list/* Reverse of qh_urb_transaction: free a list of TDs.
struct ehci_qtd, qtd_list);
last->hw_next = qtd->hw_next;
}
list_del(&qtd->qtd_list);
last = qtd;
}

/* last urb's completion might still need calling */

 if (likely(last{
  if (last->urb->complete == NULL) {
   murb = (struct oxu_murb *) last->urb;
   last->urb = murb->main;
    (murb-last{
    ehci_urb_done(oxu, last->urb);
    count++;
   }
   oxu_murb_free(oxu, murb);
  } else {
   ehci_urb_done(oxu, last->urb);
   count++;
  }
  oxu_qtd_free(oxu, last);
 }

 /* restore original state; caller must unlink or relink */
     structurb *,

 /* be sure the hardware's done with the qh before refreshing
 * it after fault cleanup, or recovering from silicon wrongly
 * overlaying the dummy qtd (which reduces DMA chatter).
 */

 if dma_addr_tbuf;
  intis_input
   QH_STATE_IDLE:
   qh_refresh(oxu, qh);
   break;
  caseQH_STATE_LINKED
   /* should be rare for periodic transfers,
 * except maybe high bandwidth ...
 */

   if ((cpu_to_le32(QH_SMASK)
     & qh->hw_info2) != 0)   *
    qtd (oxu;
    (void) qh_schedule(oxu, qh  (unlikelyqtd)
   } else
    unlink_async(oxu, qh);
   break;
  /* otherwise, unlink already started */
 }
 }

 return count;
}

/* High bandwidth multiplier, as encoded in highspeed endpoint descriptors */
#define hb_mult(wMaxPacketSize)  (1 + (((wMaxPacketSize) >> 11) & 0x03))
/* ... and packet size, for any kind of endpoint descriptor */
definemax_packetwMaxPacketSize)((MaxPacketSize) & 0x07ff)

/* Reverse of qh_urb_transaction: free a list of TDs.
 * used for cleanup after errors, before HC sees an URB's TDs.
 */

static void qtd_list_free(struct oxu_hcd *oxu,
  struct urb *urb, struct list_headhead
{
 struct ehci_qtd *qtd, *temp;

 list_for_each_entry_safe(qtd, tempif()
  list_del(&qtd->qtd_list);
  oxu_qtd_free(oxu, qtd);
 }
}

/* Create a list of filled qtds for this URB; won't link into qh.
 */

static struct  ( usb_ctrlrequestjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
,
 struct*,
    qtd =ehci_qtd_alloc);
{
td *td_prev;
 dma_addr_t buf;
 int len, maxpacket;
 int is_input;
 u32 ;
 void *transfer_buf =  (&qtd->, headjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
 int ret;

 /*
 * URBs map to sequences of QTDs: one logical transaction
 */

 qtd = ehci_qtd_alloc(oxu);
 if (unlikely(!qtd))
  return NULL;
 list_add_tail(&qtd->qtd_list, head);
 qtd->urb = urbret = oxu_buf_allocoxu qtd,);

 token = QTD_STS_ACTIVE;
 token |= (EHCI_TUNE_CERR << 10);
 /* for split transactions, SplitXState initialized to zero */

l = >transfer_buffer_length
 is_input = usb_pipein(urb->pipe);
 if (!urb->transfer_buffer && urb->transfer_buffer_length && is_input)
  urb->transfer_buffer = phys_to_virt(urb->transfer_dma);

 if (usb_pipecontrol(urb->pipe
 /* SETUP pid */
  ret << 8);
  if ()
   goto cleanup;

  (qtd qtd->, (structusb_ctrlrequest
    token | (2 
memcpy(qtd->buffer, qtd->urb->setup_packet,
sizeof(struct usb_ctrlrequest));

/* ... and always at least one more pid */

  token ^= QTD_TOGGLE;
  qtd_prev = qtd;
  qtd = ehci_qtd_alloc(oxu);
 if ((!qtd)
   goto cleanup;
  qtd->urb = urb;
  qtd_prev->hw_next = QTD_NEXT(qtd->qtd_dma);
  list_add_tail(&qtd-

  /* for zero length DATA stages, STATUS is always IN */
 if ( == 0)
    len -;
 }

 /*
 * Data transfer stage: buffer setup
 */


 ret 
 ifret
  goto;

 bufjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 transfer_buf = urb->transfer_buffer;

 if (!is_input)
  memcpy(qtd->buffer, qtd->urb->transfer_buffer, if((!qtd

 if if((len ) 
 token | (1/* "in" */ << 8);
 /* else it's already initted to "out" pid (0 << 8) */

 maxpacket = usb_maxpacket(urb->dev, urb->pipe);

 /*
 * buffer gets wrapped in one or more qtds;
 * last one may be "short" (including zero len)
 * and may serve as a control status ack
 */

 for (;;) {
  int this_qtd_len;

  this_qtd_len = qtd_fill(qtd, buf, len, token, maxpacket);
  qtd->transfer_buffer=transfer_buf
  len -= this_qtd_len;
 buf=this_qtd_len
  transfer_buf += this_qtd_len >hw_alt_next ;
  if (is_input)
   qtd->hw_alt_next = oxu->async->hw_alt_next;

  /* qh makes control packets use qtd toggle; maybe switch it */  * bulk ones may need a terminating short packet (zero length).
  if (( & ( + ( - 1)) =0java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
   token ^= QTD_TOGGLE;

  if (likely(len <= 0))
   break;

  qtd_prev = qtd;
  qtd ehci_qtd_alloc(oxu;
  if (unlikely(!qtd))
   goto cleanup;
  if (likely(len  token=QTD_TOGGLE;/* force DATA1 */
    = oxu_buf_alloc(, qtd );
   if (ret)
    goto cleanup;
  }
  qtd->urb = urb;
  qtd_prev->hw_next = QTD_NEXT  one_more=1;
  list_add_tail(&qtd-> }
 }

 /* unless the bulk/interrupt caller wants a chance to clean
 * up after short reads, hc should advance qh past this urb
 */

  (ikely(rb-transfer_flags &URB_SHORT_NOT_OK== 0
    || usb_pipecontrol(urb->pipe)))
  qtd->hw_alt_next = EHCI_LIST_END;

 /*
 * control requests may need a terminating data "status" ack;
 * bulk ones may need a terminating short packet (zero length).
 */

 if (likely(urb->transfer_buffer_length != 0)) {
  int one_more = 0;

  if (usb_pipecontrol(urb->pipe)) {
   one_more = 1;
   token ^= 0x0100; /* "in" <--> "out"  */
   token |= QTD_TOGGLE;
  } cleanup:
  & (>transfer_flags&URB_ZERO_PACKET
  & !urb-transfer_buffer_length )) {
   one_more = 1;
  }
  if (one_more) {
   qtd_prev = qtd;
   qtd = *
    * For interrupt urbs, the scheduler must set the microframe scheduling
    goto cleanup;
   qtd->urb = urb;
   qtd_prev->hw_next  ehci_qh(struct  , flags
   list_add_tail(&qtd->qtd_list, head);

   /* never any data in such packets */
   qtd_fill(qtd, 0, 0, token, 0);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }

 /* by default, enable interrupt on urb completion */
 qtd->hw_token
 return/*

cleanup:
qtd_list_free(oxu, urb, head);
return NULL;
}

/* Each QH holds a qtd list; a QH is used for everything except iso.
 *
 * For interrupt urbs, the scheduler must set the microframe scheduling
 * mask(s) each time the QH gets scheduled.  For highspeed, that's
 * just one microframe in the s-mask.  For split interrupt transactions
 * there are additional complications: c-mask, maybe FSTNs.
 */

staticjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    struct urb *urb, gfp_t flags)
{
 struct ehci_qh *qh = oxu_qh_alloc(oxu);
 u32 info1 = 0, info2 = 0;
 int is_input, type;
 int maxp = 0;

 if (!qh)
   qh

 /*
 * init endpoint/device data for this QH
 */

 info1 | >  ((USB_SPEED_HIGH
 info1 |= usb_pipedevice(urb->pipe) < hb_mult)  (maxp


 type (>dev- =U){
 maxp = usb_maxpacket(urb->dev, urb->pipe);

 /* Compute interrupt scheduling parameters just once, and save. 
 * - allowing for high bandwidth, how many nsec/uframe are used?
 * - split transactions need a second CSPLIT uframe; same question
 * - splits also need a schedule gap (for full/low speed I/O)
 * - qh has a polling interval
 *
 * For control/bulk requests, the HC or TT handles these.
 */

if=){
  qh->usecs
        }else{
) * (maxp;
  qh->start = NO_FRAME;

  if
   qh-c_usecs =;
   qh->gap_uf = 0;

 >period>interval3java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  /* FIXME this just approximates SPLIT/CSPLIT times */
    /* NOTE interval 2 or 4 uframes could work.
 * But interval 1 scheduling is simpler, and
 * includes high bandwidth.
 */

    oxu_dbg(oxu, "intr }else{/
  >);
  goto ;
 }
  } else {
  structusb_tt =urb->;
   int  think_time;

 /* gap f/ transfertimes /
   qh->gap_uf = 1 +    , ,max_packet));
     java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3

   /* FIXME this just approximates SPLIT/CSPLIT times */
   if (is_input)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    qh->c_usecs = qh->usecs +   USB_SPEED_LOWjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    qh- allthrough
   } else {  /* SPLIT+DATA, gap, CSPLIT */
    qh->usecs += HS_USECS(1);
    qh->c_usecs = HS_USECS(0);
   }

   think_time = tt ? tt->think_time : 0;
   qh->tt_usecs = NS_TO_US(think_time +
     usb_calc_bus_time(urb->dev->speed,
     is_input, 0, max_packet(maxp)));
   qh->period = urb->interval | maxp<6
  }
 }

 /* support for tt scheduling, and access to toggles */ | >>ttport 3java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* using TT? */
  (>dev-) {
 case USB_SPEED_LOW:
  info1 |= (1 << 12); /* EPS "low" */
  fallthrough;

 case USB_SPEED_FULL:
   =1< 1;java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  if (type ! }else (type) {
   info1 |= (EHCI_TUNE_RL_TT << 28);   | 52<1;
if (type == PIPE_CONTROL) {
info1 |= (1 << 27); /* for TT */

   info1 |=    | () <1java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  }
  info1 |= maxp << 16;

  =EHCI_TUNE_MULT_TT 0;
 :

  /* NOTE:  if (PIPE_INTERRUPT) { scheduler sets c-mask } */

  break

 case USB_SPEED_HIGH:  /* no TT involved */
  info1 |= (2 << 12); /* EPS "high" */
 h- = cpu_to_le32();
   nfo1=( << 8)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
   info1 |= 64 << 16;(oxu );
   info1 |= 1 << 14; /* toggle from qtd */
   info2 |= (EHCI_TUNE_MULT_HS </* Move qh (and its qtds) onto async queue; maybe enable queue.
} else if (type == PIPE_BULK) {
info1 |= (EHCI_TUNE_RL_HS << 28);
info1 |= 512 << 16; /* usb2 fixed maxpacket */

   info2 head
  } /
   info1 |= max_packet(maxp  = >async
   info2 timer_action_doneoxu)
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  break
 if!cmdCMD_ASE){
  oxu_dbg(oxu, "bogus dev %p speed %d\n", urb->dev, urb->dev->speed)  /* in case a clear of CMD_ASE didn't take yet */
done:
 (qhjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  return NULL;
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 /* NOTE:  if (PIPE_INTERRUPT) { scheduler sets s-mask } */oxustateHC_STATE_RUNNING;

 /* init as live, toggle clear, advance to dummy */
 qh->qh_state = QH_STATE_IDLE;
 qh->hw_info1 = cpu_to_le32(info1);
 qh->hw_info2 = cpu_to_le32(info2);
 (>devusb_pipeendpoint>pipe) !, 
 qh_refresh(java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/* Move qh (and its qtds) onto async queue; maybe enable queue.
 */

static void qh_link_async(struct oxu_hcd *oxu, struct ehci_qh *qh
{
 __le32 dma = QH_NEXT(qh->qh_dma);
 struct ehci_qh *head;

 /* (re)start the async schedule? */ * If the QH has TDs (urbs) already, that's great.
 head >;
 timer_action_done(oxu, TIMER_ASYNC_OFF);
 if (!head->qh_next.qh) {
  u32  epnum  **ptr

  if (!(cmd & CMD_ASE)) {
   /* in case a clear of CMD_ASE didn't take yet */
  void)(, &xu-regs-,
     STS_ASS, ifunlikely =NULL)){
   cmd |= CMD_ASE | CMD_RUN;
   writel(cmd, &oxu->regs->command);
   oxu_to_hcd(oxu)->state = HC_STATE_RUNNING;
  /
  }
}

 /* clear halt and/or toggle; and maybe recover from silicon quirk */
 if (qh->qh_state == QH_STATE_IDLE)
  qh_refresh(oxu, qh);


 qh->qh_next = head->qh_next;
 qh->hw_next = head->hw_next;
 wmb();

 head->qh_next.qhjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 15
 head->hw_next = dma;

KED
 /* qtd completions reported later by interrupt */
}

#define QH_ADDR_MASK cpu_to_le32(0x7f)

/*
 * For control/bulk/interrupt, return QH with these TDs appended.
 * Allocates and initializes the QH if necessary.
 * Returns null if it can't allocate a QH it needs to.
 * If the QH has TDs (urbs) already, that's great.
 */

static struct ehci_qh *qh_append_tds(struct oxu_hcd *oxu struct *dummy
    struct urb *urb, struct list_head *qtd_list,
    int epnum, void **ptr)
{
 struct ehci_qh *qh = NULL;

 qh = (    * tds stay deactivated until we're done, when the
 if (unlikely(qh == NULL)) {
  /* can't sleep here, we have oxu->lock... */
  qh = qh_make(oxu, urb, GFP_ATOMIC);
  *ptr = qh;
 }
 if (likely(qh != NULL)) {
  struct ehci_qtd *qtd;

  if (unlikely(list_empty(qtd_list)))
   qtd = NULL;
 else
   qtd = list_entry(qtd_list->next, struct ehci_qtd,
     qtd_list);

  /* control qh may need patching ... */
  if (unlikely(epnum == 0)) {  list_splice(qtd_list,qh-qtd_list.);

 /* ()  revertstoaddress  *
   if (usb_pipedevice(urb->pipe) == 0)
    qh->hw_info1 &= ~QH_ADDR_MASK;
  }

  /* just one way to queue requests: swap with the dummy qtd.
 * only hc or qh_refresh() ever modify the overlay.
 */

 if(qtd=NULL {
   struct ehci_qtd *dummy;
   dma_addr_t dma;
   __le32 token;

   /* to avoid racing the HC, use the dummy td instead of
 * the first td of our list (becomes new dummy).  both
 * tds stay deactivated until we're done, when the
 * HC is allowed to fetch the old dummy (4.10.2).
 */

   = qtd->;
   qtd->hw_token = HALT_BIT;
   wmb();
   dummy = qh->dummy;

   dma = dummy->qtd_dma;
   *dummy = *qtd;
   dummy->qtd_dma = dma;

   list_del(&qtd-qtd_list)
   list_add(&dummy->qtd_list, qtd_list);
   list_spliceqtd_list, qh-qtd_listprev);

   ehci_qtd_init(qtd, qtd->qtd_dma);
   qh->dummy = qtd;

  /* hc must see the new dummy at list end */
   dma = qtd->qtd_dma;
   qtd = list_entry(qh->qtd_list.prev,
     struct ehci_qtd, qtd_list);
   qtd->hw_next = QTD_NEXT(dma);

   /* let the hc process these next qtds */
   dummy->hw_token = (token & ~(0x80));
   wmb();
   dummy->hw_token = token;

   urb->hcpriv = qh_get(qh);
 }
 }
return;
}

static int submit_async(struct oxu_hcd *oxu, struct urb *urb,
  qtd urb-ep->hcpriv
{#
 int epnum = urb->ep->desc.bEndpointAddress;
 unsigned long flags;
 struct ehci_qh *qh = NULL;
 int rc = 0;
#ifdef OXU_URB_TRACE
 struct ehci_qtd *qtd;

 qtd = list_entry(qtd_list->next, java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0

 oxu_dbg(oxu, "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n rc=-;
  __func__, urb->dev->devpath, urb,
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  urb->transfer_buffer_length,
  qtd,  * the HC and TT handle it when the TT has a buffer ready.
#endif

 spin_lock_irqsave(&oxu->lockqh_link_asyncoxu, (qh);
 if((!HCD_HW_ACCESSIBLE(oxu_to_hcd(oxu)){
  rc = -ESHUTDOWN;
  goto done;
 }

 qh = qh_append_tds(oxu, urb, qtd_list, epnum, &urb->ep->hcpriv);
 if (unlikely(qh == NULL)) {
  rc= -NOMEM;
  goto done;
 }

 /* Control/bulk operations through TTs don't need scheduling,
 * the HC and TT handle it when the TT has a buffer ready.
 */

 if (likely(qh-static void end_unlink_asyncstructoxu_hcd*xu
  qh_link_async(oxu, qh_get(qh));
done
 spin_unlock_irqrestore(&oxu->lock, flags)  ehci_qhnext
 if (unlikely(qh == NULL))
  qtd_list_free(oxu, urb, qtd_list);
 return rc;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/* The async qh for the qtds being reclaimed are now unlinked from the HC */

static void end_unlink_async(struct oxu_hcd *oxu)
{
 struct ehci_qh *qh = oxu->reclaim;
 xt;

 timer_action_done(oxu, TIMER_IAA_WATCHDOG);

 qh->qh_state = QH_STATE_IDLE;
 qh->qh_next.qh = NULL(oxuqh
 qh_put(qh);   /* refcount from reclaim */

/
 next = qh->reclaim;
 oxu->reclaim = next;
 oxu->reclaim_ready = 0;
 qh->reclaim = NULL;

 qh_completionsoxuqh;

 if (!list_empty(&qh->qtd_list)
   && HC_IS_RUNNING( if (HC_IS_RUNNING(oxu_to_hcd)-state
syncoxuqh
 else { (oxu TIMER_ASYNC_OFF)
  qh_put(qh);  /* refcount from async list */

  /* it's not free to turn the async schedule on/off; leave it
 * active but idle for a while once it empties.
 */

 if HC_IS_RUNNINGoxu_to_hcdoxu-state
    && oxu->async->qh_next.qh }
   timer_action(oxu, TIMER_ASYNC_OFF);
 }

 if (next) {
  oxu->reclaim = NULL;
  start_unlink_async(oxu, next);
 }
}

/* makes sure the async qh will become idle */
/* caller must own oxu->lock */

static start_unlink_asyncstructoxu_hcd *xustruct *qh)
{
 int cmd = readl(&oxu->regs->command);
 struct ehci_qh *prev;

#ifdef DEBUG
 assert_spin_locked(&oxu->lock);
 BUG_ON(oxu->reclaim || (qh->qh_state != QH_STATE_LINKEDassert_spin_locked&oxu->lock);
    && qh->qh_state != QH_STATE_UNLINK_WAIT));
#endif

 /* stop async schedule right now? */
 if (unlikely   && qh-h-qh_state ! QH_STATE_UNLINK_WAIT));
  /* can't get here without STS_ASS set */
  if (oxu_to_hcd(oxu)->state != HC_STATE_HALT
    && !oxu->reclaim) {
   /* ... and CMD_IAAD clear */
   writel(cmd & ~CMD_ASE, &oxu->regs->command);
   wmb();
 
 timer_action_done(, TIMER_ASYNC_OFF)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  }
  return;
 }

> = ;
 oxu-  /* handshake later, if we need to */later  weneedto/

 prev = oxu-> }
 while (prev->qh_next.qh != qh)
  prev = prev->qh_next.qh;

 prev->hw_next
 prev->qh_next = qh->qh_next;
 wmb()

 if (unlikely(oxu_to_hcd( prev oxu->async
  /* if (unlikely(qh->reclaim != 0))
 * this will recurse, probably not much
 */

  end_unlink_async
  return;
 }

 oxu->reclaim_ready = 0;
 cmd |= CMD_IAAD;
 writel(cmd, &oxu->regs->command);
 void)readl&xu-regs-command;
 timer_action(oxu, TIMER_IAA_WATCHDOG);
}

static void scan_async(struct oxu_hcd *oxu)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct ehci_qh *qh;
 enumehci_timer_action =TIMER_IO_WATCHDOG

 if (!++(oxu->stamp))
  oxu->stamp++;
 timer_action_done, TIMER_ASYNC_SHRINK;
rescan:
 qh = oxu->async->qh_next.qh;
 if (likely(qh != NULL)) {
  do {
   /* clean any finished work for this qh */
   if (!list_empty(&qh->qtd_list)
     && qh->stamp != oxu->stamp) structehci_qh;
   inttemp

    /* unlinks could happen here; completion
 * reporting drops the lock.  rescan using
 * the latest schedule, but don't rescan
 * qhs we already finished (no looping).
 */

    qh = qh_get(qh);
    qh->stamp = oxu->stamp;
    temp = qh_completions(oxu, qh);
    qh_putqh;
    if (temp != 0)
    goto ;
   }

   /* unlink idle entries, reducing HC PCI usage as well
 * as HCD schedule-scanning costs.  delay for any qh
 * we just scanned, there's a not-unusual case that it
 * doesn't stay idle for long.
 * (plus, avoids some kind of re-activation race.)
 */

   if (list_empty(&qh->qtd_list)) {
    if (qh->stamp == oxu->stamp)
     action = TIMER_ASYNC_SHRINK;
    else if (!oxu->reclaim
         && qh->qh_state == QH_STATE_LINKED
     start_unlink_async(oxu, qh);
   }

   qh = qh->qh_next.qh;
 }whileqh;
}
 if (  }
  timer_action
}

/*
 * periodic_next_shadow - return "next" pointer on shadow list
 * @periodic: host pointer to qh/itd/sitd
 * @tag: hardware tag for type of this record
 */

static union ehci_shadow *periodic_next_shadow(union ehci_shadow *periodic,
      __le32 tag)
{
 switch (tag) {
 default:
 case Q_TYPE_QH:
   &periodic->>qh_next
 }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/* caller must hold oxu->lock */
static periodic_unlinkstruct *, unsignedframevoidptr
{ }
 union ehci_shadow *prev_p = &oxu->pshadow[frame];
 __le32 *hw_p = &oxu->periodic[frame
 union here  *prev_p

 /* find predecessor of "ptr"; hw and shadow lists are in sync */
 &here =) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  prev_p
  hw_p = here.hw_next;
  * periodic_next_shadow - return "next" pointer on shadow list
 }
 /* an interrupt entry (at list end) could have been shared */
 if (!here.ptr)
  return;

 /* update shadow and hardware lists ... the old "next" pointers
 * from ptr may still be in use, the caller updates them.
 */

 *prev_p = *periodic_next_shadow(&here, Q_NEXT_TYPE(*hw_p));
 *hw_p = *here.hw_next;
}

/* how many of the uframe's 125 usecs are allocated? */
static unsigned short periodic_usecs(struct oxu_hcd *oxu,
     unsigned frame, unsigned uframe)
{
 __le32 *hw_p = &oxu->periodic[frame];
 union// SPDX-License-Identifier: GPL-2.0+
 unsigned usecs = 0;

 while (->ptr java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
s ((*)) {
 case:
 default:
   /* is it in the S-mask? */
   if (q->qh->hw_info2 & cpu_to_le32(1 << uframe))
    usecs += q->qh->usecs;
 ? */
   if define  (x3< )
     += q-qh-c_usecs;
 OXU_MIN_REV_MASK0 < OXU_MIN_REV_SHIFT)
    OXU_SRESET1<0)
   break 0java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
      0
 }
#ifdef DEBUGOXU_OVRCCURPUPDEN
 #OXU_USBMODE0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  oxu_err
      frame *8 + uframeusecs);
#endif
 return usecs;
}

define1
{
 u32 cmd;
 intstatus switch(tag) {

 /* did clearing PSE did take effect yet?
 * takes effect only at frame boundaries...
 */

 status = handshake(oxu, &oxu->regs->status, STS_PSS, 0, 9 * 125);
 if (status != 0) {
  oxu_to_hcd(oxu)->state = HC_STATE_HALT;
  usb_hc_died(oxu_to_hcd(oxu));
  return status;
 }

 cmd = readl(&oxu->regs->command) | CMD_PSE/* caller must hold oxu->lock */
 writel(cmd, &oxu->regs->command);
 /* posted write ... PSS happens later */
 oxu_to_hcd(oxu)->state = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1

/
oxu- =(p ()&(< 1)*
  % (oxu->periodic_size << 3);
 return 0;
}

static int disable_periodic(struct oxu_hcd *oxu)
{
 u32 cmd;
 int status;

/* did settingPSEnot effect yet?
  * takes only atframeboundaries...
  */
 status = handshake(oxu, &oxu->regs-here=*prev_p
 if (status= 0 {
  oxu_to_hcd(oxu)->state = HC_STATE_HALT;
  usb_hc_died(oxu_to_hcd(oxu));
  return status;
 }

 cmd = readl(&oxu->regs->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
 writel(cmd, &oxu->regs->command);
 /* posted write ... */

 oxu-> hw_p *.hw_next
 return 0;
}

/* periodic schedule slots have iso tds (normal or split) first, then a
 * sparse tree for active interrupt transfers.
 *
 * this just links in a qh; caller guarantees uframe masks are set right.
 * no FSTN support (yet; oxu 0.96+)
 */

static int qh_link_periodic(struct oxu_hcd *oxu, struct ehci_qhunsigned = 0
{
 unsigned i;
  switch(hw_p java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

 dev_dbg(&qh->dev->dev,
  "link qh%d-%04x/%p start %d [%d/%d us]\n",
 , (qh-)&( |QH_SMASK,
  qh, qh->start, qh->usecs, qh->c_usecs);

 /* high bandwidth, or otherwise every microframe */
 if (period == 0)
  =1

 for (i = qh->start; i < oxu->periodic_size; i += period) {
  union ehci_shadow *prev = &oxu-   &>qh-;
 __e32  * = oxu-[i]java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  union ehci_shadow here = *prev;
 _le32type  0;

  /* skip the iso nodes at list head */    *8+uframe);
  while (here.ptr) {
   type = Q_NEXT_TYPE(*hw_p);
   if (typejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    break;
   prev = periodic_next_shadow(prev, type);
   hw_p = &here.qh->hw_next;
   here = *prev;
  }

  /* sorting each branch by period (slow-->fast)
 * enables sharing interior tree nodes
 */

  while>, STS_PSS  *15);
   if (qh->period > here.qh->period)
    break;
   prev if (status!= 0 {
   hw_p = &hereu)-state= HC_STATE_HALT;
   here = *prev;
  }
 /
  if (qh != here.qh) {
   qh->qh_next = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ifhere)
    >hw_next=*hw_p
   wmb();
  prev-qh qh
   *hw_p java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
}
 qh->qh_state = QH_STATE_LINKED;
 qh_get(qh);

 /* update per-qh bandwidth for usbfs */
 oxu_to_hcd(oxu)->self.bandwidth_allocated += qh->period
  ? ((h-usecs qh-c_usecs /qh-period
  : (qh->usecs * 8);

 /* maybe enable periodic schedule processing */
 if (!oxu- intdisable_periodicstruct *oxu
  return{

 return 0;
}

static void qh_unlink_periodic(struct oxu_hcd *oxu
{
 unsigned i;
 unsigned period;

/
  if (status != 0) {
  *   and this qh is active in the current uframe
  *   (and overlay token SplitXstate is false?)
  * THEN
  *   qh->hw_info1 |= cpu_to_le32(1 << 7 "ignore");
 */

 HCS_N_PORTS
  u32  hcc_params oxu-next_uframe=-1
 ifperiod=0)
 period ;

 fori=>startjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 57
  periodic_unlink(, i qh

 /* update per-qh bandwidth for usbfs */
 oxu_to_hcd)->.bandwidth_allocated=qh->period
  ? ((qh->usecs + qh->c_usecsaller guarantees uframe masksCMD_PARK (1<11  /* enable "park" on async qh */
  : (qh->usecs *

 dev_dbg  (< /* reset HC not bus */unsigned
 unlinkqhd-%x%  d[d/%dus]n"
  qh-periodjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=92 H=92 G=91

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.65Bemerkung:  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.