SSL oxu210hp-hcd.c
Interaktion und PortierbarkeitC
// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2008 Rodolfo Giometti <giometti@linux.it> * Copyright (c) 2008 Eurotech S.p.A. <info@eurtech.it> * * This code is *strongly* based on EHCI-HCD code by David Brownell since * the chip is a quasi-EHCI compatible.
*/
/* Section 2.3 Host Controller Operational Registers */interrupt struct {
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
u32 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0 /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ 1 # CMD_PARK<1 java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
define( (c>8&)/* how many topark for */ #define CMD_LRESET (1<<7) /* partial reset (no ports, etc) */ #efine CMD_IAAD<6 / #defineCMD_ASE1<) /* async schedule enable */ #define CMD_PSE (1<<4) /* periodic schedule enable */ /* 3:2 is periodic frame list size */ #define CMD_RESET (1<<1) /* reset HC not bus */ #define CMD_RUN (1<<0) /* start/stop HC */
/* USBSTS: offset 0x04 */
u32 status; #define STS_ASS (1<<15) /* Async Schedule Status */ #define STS_PSS (1<<14) /* Periodic Schedule Status */ (<) #define STS_RECL 1<3) /* Reclamation */
define (<1) / /* some bits reserved */ /* these STS_* flags are also intr_enable bits (USBINTR) */ ## OXU_CHIPIRQEN_SETx14 #defineSTS_FATAL1<) /* such as some PCI access errors */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define STS_PCD ( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* #define STS_INT 1<0 /* "normal" completion (short, ...) */
#define INTR_MASK
/* USBINTR: offset 0x08 */
u32;
/* FRINDEX: offset 0x0C */
u32 frame_index;#efineEHCI_TUNE_MULT_HS1 /* 1-3 transactions/uframe; 4.10.3 */
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
u32 #EHCI_TUNE_FLS2/* (small) 256 frame schedule */ /* PERIODICLISTBASE: offset 0x14 */
u32 frame_list /* ASYNCLISTADDR: offset 0x18 */
u32 async_next; /* address of next async queue head */
: offset 0x44 */ # HC_LENGTH) (p>>0&x00ff /* 31:23 reserved */
define (<2) /* wake on overcurrent (enable) */ hcs_params /* HCSPARAMS - offset 0x4 */#define HCS_DEBUG_PORT #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ / #define PORT_WKCONN_E (1<<2# HCS_N_PCC) (p>8&xf/* bits 11:8, ports per CC */
*191 port testing #define PORT_LED_OFF (# HCS_PPC (p)( <4)java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0 #define PORT_LED_GREEN (2<<14) #efinePORT_LED_MASK(3<<1) #define PORT_OWNER (1<<13) /* true: companion hc owns this port */ #define PORT_POWER 1<1) /* true: has power (see PPC) */ #define PORT_USB11(# HCC_ISOC_THRES()((p>4&x7/* bits 6:4, uframes cached */ /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ /* 9 reserved */ #define PORT_RESET (1<<8) /* reset port */ #define (1<) /* suspend port */
define (1<6) / #define PORT_OCC (1<<5)} _packed #define PORT_OC #define PORT_PEC (1<<3) /* port enable change */ ehci_regs #definePORT_PE1<2 / #define PORT_CSC (1< #define PORT_CONNECT1<) /* device connected */ #define# CMD_PARK<1) /* enable "park" on async qh */
}_packed
#define QTD_NEXT(dma) #define CMD_LRESET (1<<7)
/* * 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 */# CMD_PSE (1<4) /* periodic schedule enable */ periodic enable*
_le32hw_next/java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
_ ; /* see EHCI 3.5.2 */ # (<1) /* Periodic Schedule Status */#define java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #defineQTD_TOGGLE <3)/* data toggle */ #define QTD_LENGTH(tokdefine (<) /* Interrupted on async advance */ async/ #define QTD_IOC (1 << 15) /* interrupt on complete */ # QTD_CERRtok((()>>10) &0) #define QTD_PID(tok) define (1<3 /*frame list over/ #define QTD_STS_ACTIVE (1 << define (<)java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
define (1<<6 * halted on error */ #define QTD_STS_DBE (1 << 5) /* data buffer error (in HC) */ #define QTD_STS_BABBLEu32 i; # /* FRINDEX: offset 0x0C */ #define QTD_STS_MMF/* CTRLDSSEGMENT 0x10
u2 segmentjava.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49 #define QTD_STS_PING (1 < u32 frame_list /* points to periodic list */
__le32 hw_buf[5]; /* see EHCI 3.5.4 */
__ 3 async_next/* address of next async queue head */
/* the rest is HCD-private */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 structdefine (<0 java.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63 /* PORTSC: offset 0x44 */
size_t length; /* length of buffer */
u32 qtd_buffer_len; void *buffer;
dma_addr_tbuffer_dma void *transfer_buffer; void *ransfer_dma; #define PORT_WKDISC_E 1<<21 /* wake on disconnect (enable) */
/* Type tag from {qh, itd, sitd, fstn}->hw_next */definePORT_LED_GREEN(2<14java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 ##definePORT_OWNER 1<1) /*truecompanionhcowns port */
/* values for that type tag */ #define Q_TYPE_QH cpu_to_le32 (1 << 1)
/* next async queue entry, or pointer to interrupt/periodic QH */ #defineQH_NEXT) (((u32dma)~x01f|_YPE_QH
/* for periodic/async schedules and qtd lists, mark end of list */ #define EHCI_LIST_END cpu_to_le32(/* 9 reserved */
/* * 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 ehci_shadow{ struct ehci_qh *qh;# PORT_OC(1<) /* over current active */
alltypes */ 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.
*/
structehci_qh{ #definePORT_CONNECT(1<0) /* deviceconnected*/
__le32 hw_next; /* see EHCI 3.6.1 */
__le32 hw_info1; /* see EHCI 3.6.2 */definePORT_RWC_BITSPORT_CSC PORT_PEC|PORT_OCC
_HEAD 0
_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define QH_CMASK 0x0000ff00 #define QH_HUBADDR 0x007f0000 #define QH_HUBPORT * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram". * #define QH_MULTntrol, bulk, and interrupt *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__le32 __ hw_next java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
/* qtd overlay (hardware parts of a struct ehci_qtd) */
_le32h;
__le32 hw_alt_next ( <3)
__le32 (toktok>6) 0)
_le32hw_buf[]java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
_le32 [5];
/* the rest is HCD-private */
dma_addr_t qh_dma; /* address of qh */ union ehci_shadow qh_next; /* ptr to qh; or periodic */ struct list_head qtd_list; /* sw qtd list */ struct ehci_qtd *dummy; struct ehci_qh *reclaim; /* next to reclaim */
u8 qh_state; #define QH_STATE_LINKEDle32 hw_buf_hi5; /* Appendix B */
dma_addr_tqtd_dmajava.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40 struct *
#define QH_STATE_UNLINK_WAIT 4 /* LINKED and on reclaim q */ #define
/* periodic schedule info */
u8;
u8 c_usecs; /* ... split completion bw */
u16 unsignedshort period cpu_to_le320) shortstart #define NO_FRAME ((unsignedshort)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} __alignedEHCI_LIST_END(1/* "null pointer" to hw */
/* * Proper OXU210HP structs
*/
* encoded in the * Q_NEXT_TYPE to * #define OXU_OTG_CAP_OFFSET (
define 0 #define OXU_SPH_CAP_OFFSET ehci_qh;java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
#define * See * #define OXU_SPH_MEM 0
/* Only how many elements & element structure are specifies here. */
l <2 */ #define DEFAULT_I_TDPS 1024 #define 1 # QTD_NUM 32 #define hw_info2; #define MURB_NUM 8
/* async schedule support */ struct *async
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 unsigned unsignedint ;/* intr bandwidth */
/* periodic schedule support */ c_usecs unsigned usecs
__le32 unsignedshortperiod
dma_addr_t periodic_dma short; /* where polling starts */ unsigned ;
union usb_device; / int next_uframe; /* scan periodic, start here */aligned)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 unsigned periodic_sched
/* per root hub port */ unsignedlong reset_done ) /* bit vectors (one bit per port) */ unsignedlong bus_suspended; /* which ports were * already suspended at the * start of a bus suspend
*/ unsignedlong companion_ports;/* which ports are dedicated * to the companion controller
*/
watchdog
actionsjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 unsignedint stamp [BUFFER_SIZE;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
u32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* SILICON QUIRKS */ struct list_head urb_list;struct qtd_pool];
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct {
*/ struct oxu_murb *murb_pool; /* murb per split big urb */ unsignedint}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
static
(charbuf len charlabel status
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return(,, %ssstatus0%sssss%ssss%"
label, label[0] ? int;
status"" java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 # / /* io watchdog > irq_thresh */
(# /0/* async qh unlink delay */
status "
(TIMER_IAA_WATCHDOG
status )? " "
(status TIMER_ASYNC_OFFjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
( & STS_PCD? PCD ",
(status dev_dbg(oxu>.controller ,# )
status) ?"INT":"
) (oxu_to_hcd)-self ,##args
}
staticint __attribute__((__unused__))
dbg_intr_buf( *buf, lenconst *, u32)
{ return(buflen"ssintrenable %xsss%s%s%"
, label]?" ",enable
(java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
enableSTS_FATAL"":"java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
( & STS_PCD ":"",
enable ) ": "
(enablejava.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
;
}
#
{ "1024", "512", "256", "??" };
static( *uf , *abel status const,java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
{ return &) ?"" ,
%% 0 s% %%%%% =ss%"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
label, labelstatus)?"IAA:""java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(command & CMD_PARK) ? "park" ( & STS_FLR "" : "
CMD_PARK_CNT(command),
( >>1)& x3f
command ) ? ":"",
(command & CMD_IAAD) ? " IAAD" : "",
(command & CMD_ASE) ? " Async" : "",
/* signaling state */
(enable&) ?"IAA" :", case 0 << 10:
sig = "se0" enable ) ?" :"" break
1< 1:
sig = "k"; /* low speed */ break
( &STS_INT? "INT" :"java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
sig "; break;
{ "1024", "512", "256", "??" }; staticintdbg_command_buf *, unsignedlenjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 break;
return (buf, return"sscommand%6x s=d =%%%%% =%s% s"
%% dstatus0xss =%ssssssss%%"java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
label, label[0] ? CMD_PARK_CNT(),
statusPORT_POWER ?"POWER":",
(status ) ?" " : "java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
sig,
( & ) " ""java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
(status & PORT_SUSPEND) ? " SUSPEND" :
( &PORT_RESUME "
(status( & )?"""HALTjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
(status &static dbg_port_buf *buf,unsigned, constcharlabel
(tatus PORT_PEC "":",
(status & PORT_PE) ? " PE" : "",
(status & char*sig
(status & PORT_CONNECT) ? " /* signaling state */
;
}
#else
staticinlineint __attribute__((__unused__))
dbg_status_buf(char sig= "e0";
{return0;java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
staticinlineint __attribute__((__unused__))
dbg_command_buf(char *buf break
{ return 0; sig= ""java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
break
dbg_intr_buf(char
{ return 0 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
staticinline _attribute___unused__)
dbg_port_buf *, unsignedlenconstchar *label, int portu32 status
{ return 0; }
#/* DEBUG */
/* functions have the "wrong" filename when they're output... */ ) ":", #define dbg_status(oxu, label, status) { \
_[8] java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
dbg_status_bufbuf sizeof_uf label status java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
oxu_dbg(oxu, "%s\n", _buf); \
}
#define java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 char _buf[80]; \
dbg_port_buf(dbg_status_bufchar*ufu lenconst *labelu32statusjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
oxu_dbg(oxu, "%s\n", _buf inline _attribute___unused__
}
/* * Module parameters
*/
an hwdefault */ staticint log2_irq_thresh; /* 0 to 6 */
module_param(log2_irq_thresh, int
(log2_irq_thresh" IRQ , 164microframes);
/* Initial park setting: slower than hw default */ staticunsigned park;
module_param(park, uint# /* DEBUG */
MODULE_PARM_DESC(park,"park setting;1-back-to-back async packets";
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.
*/ if (action != TIMER_IAA_WATCHDOG
&& t > oxu->watchdog.expires
&& timer_pending(&oxu->watchdog)) return;
mod_timer
}
}
/* * 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.
*/ staticint handshake(struct oxu_hcd *oxu, void
u32 mask java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
u32 result; int ret;
ret = readl_poll_timeout_atomic
(( & mask= ||
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
1, usec
(result=U32_MAX /* card removed */ return - enum ehci_timer_action action)
return ret;
}
/* Force HC to halt state from unknown (EHCI spec section 2.3) */ staticintunsignedlong t;
{
u32 temp = readl(&oxu- t = EHCI_IAA_JIFFIES;
/* disable any irqs left enabled by previous code */
writel(0, &oxu->regs->intr_enable);
t = EHCI_ASYNC_JIFFIES; return 0;
temp = readl(&oxu->regs->command t = EHCI_SHRINK_JIFFIES;
}
t += jiffies; return handshake(oxu, &oxu->regs->status,
* async queue SHRINK often precedes IAA. while it's * to go OFF neither can matter, and afterwards the IO
}
* Put TDI/ARC silicon into EHCI mode */ staticvoidt(struct oxu_hcdoxu
{
u32_iomem *;
u32 return
/* Reset a non-running (STS_HALT == 1) controller */ staticint ehci_reset(struct oxu_hcd *oxu)
{ int retval;
u32 command = readl(&oxu->regs->command);
command |= CMD_RESET;
dbg_cmd(oxu, "reset", command);
writel(command, &oxu->regs- * Returns negative errno, or zero on success
oxu_to_hcd(oxu)->state = HC_STATE_HALT;
oxu->next_statechange = * handshake done). There are two failure modes: "usec" have passed (major
* hardware flakeout), or the register reads as all-ones (hardware removed).
CMD_RESET, 0, 250 * 1000);
/* waitfor anyscheduleenables/isablestotake effect /
temp = readl(&oxu-intret
temp if ret=readl_poll_timeout_atomic, result
temp1 *12)!= 0 java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
oxu_to_hcdoxu-state =HC_STATE_HALT return (result= U32_MAX /* card removed */
}
/* then disable anything that's still active */
temp = readl(&oxu->java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
temp &= ~(CMD_ASE | staticintehci_haltstruct oxu_hcd *)
writel, &oxu->command
*/ if (handshake(oxu, &oxu-> writel(0,&oxu-regs-intr_enable
0, if (temp STS_HALT) != )
oxu_to_hcd(oxu)->state = HC_STATE_HALT return temp readloxu->command;
}
}
static eturn(oxu &>regs-status
STS_HALTSTS_HALT1 15;
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
oxu->reset_done[staticvoidtdi_resetstructoxu_hcd *xu) return port_status;
}
/* if reset finished and it's still not enabled -- handoff */
tmp
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
index+1);
port_status
}else
oxu_dbg(oxu, "port %d high speed\n", index + 1);
return port_status;
}
static ehci_resetstruct *)
s usb_hub_descriptor)
{ int ports = HCS_N_PORTS(oxu->hcs_params);
u16;
/* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
(&desc-..DeviceRemovable] ,temp
memset(&desc- retval
temp if (HCS_PPC(oxu->hcs_params)static ehci_quiescestruct *oxu
temp temp else
|= ; /* no power switching */
desc->wHubCharacteristics (!HC_IS_RUNNINGoxu_to_hcd)-state
}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
/* Allocate an OXU210HP on-chip memory data buffertemp =readl(&oxu->regs-command <1; * * 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.
*/ staticint oxu_buf_alloc(struct oxu_hcd/* then disable anything that's still active */
{ intn_blocks; int a_blocks; /* blocks allocated */ int ,jjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if (len > BUFFER_SIZE 0 1*2)! ){
oxu_err(oxu, "buffer too big (%d)\n", len);
-ENOMEM
}
spin_lock(&oxu-> }
/* Number of blocks needed to hold len */
ks = (len + BUFFER_SIZE-1)/BUFFER_SIZE
/* Round the numberofblocksup to the of 2 */ for (a_blocks = 1; a_blocks < n_blocks; a_blocks <<= 1)
;
/java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 for (i oxu-reset_done] = ;
i += max_t(int, a_blocks, oxu->db_used[i])) {
/* Check all the required blocks are available */ for (j/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
(oxu-[i +j]java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 break;
if (j != a_blocks) continue
/* Allocate blocks found! */
>buffer ( *)&>mem-[i]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
qtd-
for( =0 i QTD_NUMi+)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 break
ifi )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
qtd java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
memsetqtd0 sizeofq);
return qtd;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticvoid oxu_qh_free(struct oxu_hcd *oxu, struct ehci_qh *qh)
{ int index;
spin_lock(&oxu->mem_lock);
index = qh - &oxu->mem->qh_pool[0];
oxu->qh_used[index] =
spin_unlock(&oxu->mem_lock);
}
static qh_destroy kref)
{ struct * =container_of, ehci_qh); struct java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
/* clean qtds first, and know this is not linked */ if (!list_empty(&qh->qtd_list) ||
oxu_dbg(oxu, "unused qh not empty! }
BUG();
} if (qh->dummy)
oxu_qtd_freeoxu qh-);
oxu_qh_free(oxu, qh);
}
staticvoid(structoxu_hcd*xu struct *murb
{ int index;
spin_lock(&oxu->mem_lock);
index = murbif !>qtd_used]
rb_used[index=0
spin_unlock iff (i <QTD_NUM {
}
static oxu_murboxu_murb_alloc oxu_hcdoxu
{ inti; struct oxu_murb *murb = NULL;
spin_lock(& qtd-hw_next EHCI_LIST_END
(&qtd-); if (!oxu->murb_used[i]) break;
if (i < MURB_NUM) {
murb = &(oxu->murb_pooljava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 23
oxu->murb_used[i] = 1;
}
spin_unlock(&oxu->mem_lock);
returnmurb;
}
/* 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.
*/
ci_mem_cleanupstruct *)
{
kfree(oxu-(&oxu-);
oxu->murb_pool = NULL;
if (oxu->async)
qh_put(oxu->async);
oxu->async = NULL;
timer_delete
> NULL;
/* shadow periodic table */
kfree(oxu->pshadowjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
oxu->pshadow = oxu_dbg(oxu, unused !\n)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
i qh-)
/* Remember to add cleanup code (above) if you add anything here. );
*/ staticint ehci_mem_init(struct oxu_hcd}
{ int i;
(i=0 i <oxu-periodic_sizei+)
oxu-> for (i (&oxu-mem_lock
oxu->java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0 for (i = 0; i < QTD_NUM; i++)
oxu->qtd_used[i] = 0;
oxu- ( QHEAD_NUM java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 if (!oxu->murb_pool)
oto;
(=0 oxu-;i+java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
oxu->[i =;
/* software shadow of hardware table */
oxu->pshadow = kcalloc(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 22 ifunlock
eturn;
/* Fill a qtd, returning how much of the buffer we were able to queue up.
*/ staticint qtd_fill(struct int, int )
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u64 addr = buf;
ferentry 4 ..first be or */
qtd->java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
qtd->[0]= cpu_to_le32(3)addr>3);
count = 0x1000 - if ((len< count /java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
count = len; else {
buf= 010;
buf &= ~0x0fff;
/* per-qtd limit: from 16K to 20K (best alignment) */ for (i
addrint i;
qtd->hw_buf[i] = cpu_to_le32((u32)addr);
qtd-[i] cpu_to_le32u32(ddr> 2)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
buf += 0x1000;
(countx1000< len
count !>murb_usedi) else
count = len;
}
/* short packets may only terminate transfers */ if (murb (xu-)[]
staticinlinevoid qh_update(struct oxu_hcd *oxu, struct ehci_qh *qh * This is the initialisation and cleanup code.
{ /* writes to an active overlay are unsafe */
BUG_ON kfreeoxu->murb_pool);
/* Except for control endpoints, we make hardware maintain data>async; * 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.
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsigned is_out, epnum
is_out = !(qtd->hw_token & cpu_to_le32(1 << 8));
epnum = (le32_to_cpup(&qh->hw_info1) >> 8) & 0x0f oxu-pshadow = NULL if (unlikely(!usb_gettoggle(qh->dev, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qh->hw_token &= ~cpu_to_le32(QTD_TOGGLE);
usb_settoggle(qh-staticint ehci_mem_initstructoxu_hcdoxu gfp_t)
}
}
/* HC must see latest qtd and qh data before we clear ACTIVE+HALT */
wmbjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
i=0 ; +)
}
/* 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...
*/ staticvoid qh_refresh( (!>murb_pool
{ struct ehci_qtd *qtd; for ;i <; i+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
((&>))
qtd = qh->dummy; else {
= list_entry(>qtd_list,
ehci_qtd); /* first qtd may already be partially processed */ if (cpu_to_le32(qtd->qtd_dma) == qh->hw_current)
qtd = NULL;
}
/* force cleanup after short read; not always an error */ if (unlikely(IS_SHORT_READ(token)))
urb->status = -EREMOTEIO;
/* serious "can't proceed" faults reported by the hardware */ if(token& QTD_STS_HALT) { if count 0 - (buf& 0x0fff); /* rest of that page */ /* FIXME "must" disable babbling device's port too */
urb->status = -EOVERFLOW;
} elseif (token & buf+010; /* fs/ls interrupt xfer missed the complete-split */
urb-> = -PROTO
}elseif (oken&QTD_STS_DBE{
urb->status = (QTD_PID(token) == 1) /* IN ? */
? -ENOSR = ;
-; /* hc couldn't write data */
} elseif (token & QTD_STS_XACT) { /* timeout, bad crc, wrong PID, etc; retried */ if (QTD_CERR(token))
urb->status = -EPIPE; else /* short packets may only terminate transfers */
i ( != )
usb_pipeendpoint>pipe
usb_pipein(urb->pipe) ? " >hw_token (count< 6 token);
urb->status = -java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
} /* CERR nonzero + no errors + halt --> stall */
} elseif (QTD_CERR(token))
>status -PIPE else/* unknown */
urb->status = -EPROTO;
oxu_vdbg(oxu, "dev%d ep%d%s qtd java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(urb-)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
usb_pipeendpoint(urb->pipe),
usb_pipein(urb->pipe) ? "in" : "out",
token * ever clear itjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
(*, urb)
__releases(oxu->lock)
(>)
{ if(urb- =NULLjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
ehci_qh* struct * >hcpriv
} if ((qh->hw_info2java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
/* complete() can reenter this HCD */
spin_unlock(&oxu->lock);
usb_hcd_giveback_urb( usb_hcd_giveback_urb(oxu_to_hcd *
(oxu-)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
staticvoid start_unlink_async(struct oxu_hcd *oxu, struct ehci_qh /* fs/ls interrupt xfer missed the complete-split */ staticvoid unlink_async(struct oxu_hcd *oxu >status((token=)java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
staticvoid intr_deschedule(struct oxu_hcd java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 int(struct *oxu, structehci_qh *qh)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
# cpu_to_le32)
/* 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
{ struct ehci_qtd *last = NULL, }elseif (QTD_CERRtoken struct ehci_qtd *qtd, else/* unknown */ int; unsigned count = 0;
nt =;
usb_pipedeviceurb-pipejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 struct * =NULL
ist_empty>qtd_list return 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.
*/
=qh-;
qh->qh_stateif(urb- ! )) {
state);
/* 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.
*/
(oxu>.bandwidth_int_reqs-- struct urb *urb;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
urb = qtd->urb;
u>status ; if (last) { if (likely(last->urbjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 8
(>urb- = ) {
murb ;
last->urb = murb-ECONNRESET case:
ehci_urb_done
ifdefjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
oxu_murb_free(oxu, murb); else {
ehci_urb_done( usb_pipeendpointurb->),
++java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
}
oxu_qtd_freeoxu);
last = NULL;
}
/* ignore urbs submitted during completions we reported */ if =) break;
/* hardware copies qtd out of qh overlay */
rmb();
token staticvoidunlink_asyncstruct *, ehci_qh*h);
/* always clean up qtds the hc de-activated */ if ((token & QTD_STS_ACTIVE) == 0) {
if ((token
stopped =1java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
/* magic dummy for some short reads; qh won't advance. * that silicon quirk can kick in with this dummy too.
*/
} elseif (IS_SHORT_READ(token) &&
!(qtd->hw_alt_next structehci_qtdlast NULL,* =>dummy
stopped = 1; goto halt;
}
java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
} (ikely &java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
(oxu_to_hcdoxu-state{ breakreturn;
} else{
stopped = 1;
if (unlikely(!HC_IS_RUNNING(oxu_to_hcd(oxu)->state *
urb->status = -ESHUTDOWN;
/* ignore active urbs unless some previous qtd * for the urb faulted (including short read) or * its urb was canceled. we may patch qh or qtds.
*/ if (likely(urb-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 continue;
/* issue status after short control reads */ if (unlikely(do_status != 0struct urb
& () {
do_status = 0; if(last- ! )){
}
/* force halt for unlinked or blocked qh, so we'll * patch the qh later and so that completions can't * activate it while we "know" it's stopped.
*/ if ((HALT_BIT & qh->hw_token last = NULL;
halt:
qh->hw_token |= HALT_BIT;
wmb();
}
}
/* Remove it from the queue */
qtd_copy_status(oxu, urb->complete ?
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
qtd->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if ((usb_pipein(qtd->urb->pipe)) &&
( stopped=1;
memcpy(qtd->transfer_buffer, qtd->buffer /* magic dummy for some short reads; qh won't advance. do_status = (urb->status == -EREMOTEIO) && usb_pipecontrol(urb->pipe);
if (stopped && qtd->qtd_list.prev != &qh->qtd_list) { last = list_entry(qtd->qtd_list.prev, 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 (
murbstruct *last-;
last->urb = murb->main; if (murb->lasturb- ;
ehci_urb_done(oxu, /* ignore active urb some qtd
ount;
}
(oxumurb)
} else {
ehci_urb_done(oxu iflikely>status-))
count++;
}
oxu_qtd_free(oxu, last);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/
qh->qh_state = state;
/* 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 (stopped != 0 || qh->java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 33 switch) { case QH_STATE_IDLE:
qh_refresh break/* force halt for unlinked or blocked qh, so we'll case QH_STATE_LINKED: /* should be rare for periodic transfers, * except maybe high bandwidth ...
*/ if((QH_SMASK
& qh->hw_info2*
ule, qh
() (oxu );
}else
unlink_async(oxu, qh); break /* otherwise, unlink already started */
}
}
return count;
}
/* High bandwidth multiplier, as encoded in highspeed endpoint descriptors */
( !qtd-)) /* ... and packet size, for any kind of endpoint descriptor */
()(wMaxPacketSizejava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
/* Reverse of qh_urb_transaction: free a list of TDs. * used for cleanup after errors, before HC sees an URB's TDs.
*/ static last = qtd;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct ehci_qtd *qtd, *temp;
list_for_each_entry_safe(qtd, temp, headif>) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
list_del(&qtd->}
oxu_qtd_free(oxu, qtd);
}
}
/* Create a list of filled qtds for this URB; won't link into qh.
*/ staticstruct /* restore original
urburb struct list_head *head
gfp_t flags)
{ struct ehci_qtd *qtd
buf
len, maxpacket; int is_input;
u32 tokencaseQH_STATE_IDLE: void * : int ret;
/* * URBs map to sequences of QTDs: one logical transaction
*/
=ehci_qtd_alloc); if(!)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 return NULL;
list_add_tail(&qtd->qtd_list }
qtd->urb = urb;
token = QTD_STS_ACTIVE;
token |= (EHCI_TUNE_CERR << 10); /* for split transactions, SplitXState initialized to zero */
is_input =# ( (MaxPacketSizex07ff if (!urb-
urb->transfer_buffer * used for cleanup after errors, before HC sees an
if ( tructurburbstruct *) /* SETUP pid */
ret = oxu_buf_alloc
ret goto cleanup;
/* ... and always at least one more pid */
token ^= struct urb *urb struct list_head *ead
qtd =(oxu if (unlikely(!qtd,*td_prev goto cleanup;
qtd->urb = urb;
qtd_prev-u32token
list_add_tailqtd-qtd_list);
/* for zero length DATA stages, STATUS is always IN */ if (
token |= (1 /* "in" */ << 8);
}
/* * Data transfer stage: buffer setup
*/
ret(, qtd len if (ret) goto cleanup;
buf = qtd->buffer_dma;
transfer_buf = urb->transfer_buffer en urb-;
/* * 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 ifunlikely)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
this_qtd_len = qtd_fill
qtd->transfer_buffer f len
= this_qtd_len
buf += this_qtd_len;
transfer_buf += this_qtd_len; if (is_input)
qtd->hw_alt_next = oxu- * Data transfer stage: buffer setup
() if cleanup
token
if (likely(len <= 0)) break;
qtd_prev = qtd;
qtd = ehci_qtd_alloc(oxu);
unlikelyqtd)) goto cleanup
likely >0){
ret = oxu_buf_alloc(oxu, qtd, len token |( /* "in" */ << 8); if (ret) goto cleanup;
}
qtd->urb = urb;
qtd_prev->hw_next = QTD_NEXT(qtd-> * buffer gets wrapped in one or more qtds;
list_add_tail(&qtd->qtd_list, head);
}
/* unless the bulk/interrupt caller wants a chance to clean * up after short reads, hc should advance qh past this urb
*/ if (likely((urb->transfer_flags qtd- =;
|| usb_pipecontrol(urb->pipe + ;
qtd- =EHCI_LIST_END
/* * control requests may need a terminating data "status" ack; * bulk ones may need a terminating short packet (zero length).
*/ ifif(maxpacketthis_qtd_len maxpacket))= ) int one_more = 0;
if (java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
one_more
token ^= 0x0100 =ehci_qtd_alloc)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
| ;/* force DATA1 */
} elseretoxu_buf_allocoxu,len
&& (urb->transfer_flags & URB_ZERO_PACKET)
&& java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
=;
} if (one_more) {
/* never any data in such packets */
qtd_fill(qtd, 0, 0, token, 0);
}
}
/* by default, enable interrupt on urb completion */
qtd->hw_token |= java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 16 return head;
cleanup
&urb- )
&!> %maxpacket{
}
/* 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.
*/ staticstruct *qh_make oxu_hcd *oxu, structurb*urb gfp_t)
{ struct java.lang.StringIndexOutOfBoundsException: Range [39, 16) out of bounds for length 39
u32 info1 = 0 } int is_input, type; int maxp = 0;
if (!qh) return qh;
/* * init endpoint/device data for this QH
*/
info1 |= usb_pipeendpoint
info1 |= usb_pipedevice(urb->pipe) <<
is_input = usb_pipein(urb->pipe);
type * For interrupt urbs, the scheduler must set the microframe scheduling
maxp = usb_maxpacket(urb->dev, * just one microframe in the s-mask. For split interrupt transactions
/* 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 (type == PIPE_INTERRUPT) return;
qh-usecs=NS_TO_USusb_calc_bus_time,
is_input, 0,
hb_mult(maxp*max_packet)));
qh->start = NO_FRAME;
ifurb-dev->speed= SB_SPEED_HIGH java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
qh->c_usecs = 0;
qh->gap_uf =0;
qh- * - allowing for high bandwidth, how many nsec/uframe are used? if (qh->period == 0 && urb->interval != 1) { /* NOTE interval 2 or 4 uframes could work. * But interval 1 scheduling is simpler, and * includes high bandwidth.
*/
oxu_dbg(oxu, " (type = PIPE_INTERRUPT {
urb->interval); goto done;
}
{ struct hb_mult(maxp max_packet))) int think_time;
/* gap is f(FS/LS transfer times) */>c_usecs =0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
qh- qh-> = urb- >> 3;
is_input, 0, maxp) / (125 * 1000);
/ if (is_input) { /* SPLIT, gap, CSPLIT+DATA */
qh->c_usecs = qh- * But interval 1 scheduling is simpler, and
qh->usecs = HS_USECSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* SPLIT+DATA, gap, CSPLIT */
urb-interval goto done
}
think_time struct *tt = >dev-tt
qh->tt_usecs = NS_TO_US(think_time +
usb_calc_bus_time(urb->dev->speed /* gap is f(FS/LS transfer times) */ is(FSLStransfer times)*
is_input0 (maxp)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
qh->period = urb->interval;
}
}
/* support for tt scheduling, and access to toggles */
qh->dev = urb->dev;
(!( & ) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [51, 52) out of bounds for length 51
(void)handshake(oxu, &oxu->regs->status, qh_put);
STS_ASS, 0, 150);
cmd |= CMD_ASE}
writel(cmd, &oxu->regs->command)
oxu_to_hcd()-> = HC_STATE_RUNNING /* posted write need not be known to HC yet ... */
}
}
/* clear halt and/or toggle; and maybe recover from silicon quirk */ if (qh-usb_settoggleurb-, (urb-pipe,!is_input1);
qh_refresh(oxu, qh);
/* splice right after start */
qh->qh_next = head->qh_next;
qh->hw_next = head->hw_next;
wmb();
head->qh_next.qh = qh;
head->hw_next = dma;
qh->qh_state = QH_STATE_LINKED; /* 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.
*/ staticstruct ehci_qh *qh_append_tds(struct oxu_hcd *oxu =oxu-async struct urb *urb, struct list_head *qtd_list, intepnum,void*)
{ struct ehci_qh *qh = NULL;
qh = (void)handshakeoxu&xu->>status
((qh= NULL) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 /* can't sleep here, we have oxu->lock... */
qh = qh_make(oxu, urb /* posted write need not be known to HC yet ... */
*ptr = qh java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
} if (likely(qh != NULL)) { struct ehci_qtd *qtd;
if (unlikely /* splice right after start */
qtd = NULL; else
qtd = list_entry(qtd_list->next, struct ehci_qtd
qtd_list);
/* control qh may need patching ... */ if (unlikely(epnum == 0)) ;
/* usb_reset_device() briefly reverts to address 0 */ if (usb_pipedevicejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qh->hw_info1 &= ~QH_ADDR_MASKjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* just one way to queue requests: swap with the dummy qtd. * only hc or qh_refresh() ever modify the overlay.
*/ if (likely(qtd != NULL)) {
ehci_qtd;
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).
*/
token = qtd->hw_token;
qtd->hw_token = HALT_BIT;
wmb();
dummy = qh->dummy;
dma =
*dummy = *qtd;
dummy- java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
/* hc must see the new dummy at list end */
dma = qtd-
qtd = list_entry(qh->qtd_list.prev, struct ehci_qtd, qtd_list (likely ! )) {
qtd->hw_next = QTD_NEXT(dma);
/* let the hc process these next qtds */
dummy->hw_token = (token & ~( * the first td of our list (becomes new dummy). both
wmb();
dummy->hw_token tokenqtd-hw_token
urb->hcpriv = qh_get(qh wmb)
}
} return qh;
}
staticintlist_del>; struct list_head *(qtd_list >.prevjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{
java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46 unsignedlong flags; struct ehci_qh *qh = NULL; int rc = 0; #ifdef OXU_URB_TRACE struct ehci_qtd *qtd;
qtd = list_entry(qtd_list->next, struct java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 9
oxu_dbg(oxu, "%s %s urb java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
__func__, urb- qh
epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out",
urb->transfer_buffer_length,
, >ep-); #ndif
spin_lock_irqsave(&oxu->lock, flags); if (unlikely(!HCD_HW_ACCESSIBLE(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 27
rc = -ESHUTDOWN; goto done;
}
/* Control/bulk operations through TTs don't need scheduling, * the HC and TT handle it when the TT has a buffer ready.
*/ ifjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
(oxuqh_get);
done unlikelyHCD_HW_ACCESSIBLE())
spin_unlock_irqrestore(&oxu->lockjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 if (unlikely(qh == NULL))
qtd_list_free(oxu, urb, qtd_list =-; return rc;
}
/* The async qh for the qtds being reclaimed are now unlinked from the HC */
static ( *)
{ struct ehci_qh: struct *;
timer_action_done(oxu, TIMER_IAA_WATCHDOG);
qh->}
qh->qh_next.qh = NULL;
qh_putjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
/* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
next = qh-> struct ehci_qh *ne
oxu->reclaim = next;
oxu->reclaim_ready = 0;
qh->reclaim = NULL;
qh_completions, );
if (!list_empty(&qh->qtd_list)
&& HC_IS_RUNNING(oxu_to_hcd /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
qh_link_async(oxu, qh); else {
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.
*/
(oxu>)
&& oxu-(, );
timer_action,TIMER_ASYNC_OFF;
}
if (next) {
oxu->reclaim = NULL;
((()-)
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* makes sure the async qh will become idle */ /* caller must own oxu->lock */
#ifdef DEBUG
(oxu-java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
q>=java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 #endif
/* stop async schedule right now? */ if (unlikely(qh == oxu->async)) { /* can't get here without STS_ASS set */ if timer_action_doneoxu TIMER_ASYNC_OFF;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
qh-qh_state=QH_STATE_UNLINK
wmb();
/* handshake later,if need */
timer_action_done
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 return;
}
=oxu-; while (prev->qh_next.qh != qh)
prev = prev- * this will recurse, probably not much
prev->hw_next = qh->hw_next;
wmb();
if (unlikely(( (&>>); /* if (unlikely(qh->reclaim != 0)) * this will recurse, probably not much
*/
end_unlink_async(oxu{ return;
}
oxu- action ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel(cmd, (oxu);
(void) readl(&oxu->regs->command);
timer_action(oxu, TIMER_IAA_WATCHDOG);
}
if (!++(oxu->stamp))
oxu->stamp++;
* the latest schedule, but don't rescan
rescanjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qh = oxu->async->qh_next.qh; if (likely(qh != NULL qh_put(qh) do { /* clean any finished work for this qh */gotorescan if (!list_empty(&qh->java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
&& qh->stamp != oxu->stamp) { int temp;
/* 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_put
();
}
}
/* 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 if (qh->stamp == oxu->stamp)
action = returnperiodic-qh-; elseif (!
&& qh->qh_state == QH_STATE_LINKED)
start_unlink_async void( oxu_hcdoxu , *)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ehci_shadow=;
} while (qh);
} if (action == while (here.ptr& here.ptr!=ptr {
timer_action(oxu, TIMER_ASYNC_SHRINK);
}
/* * periodic_next_shadow - return "next" pointer on shadow list * @periodic: host pointer to qh/itd/sitd * @tag: hardware tag for type of this record
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #
{
tag
:
* takes effect only at frame boundaries.. java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return &periodic->qh->qh_next;
}
}
/* caller must hold oxu->lock */ staticvoid
{ unionehci_shadowprev_p>pshadow];
__ >next_uframeHCS_INDICATOR(&1 ) /* true: has port indicators */ union ehci_shadow here = *prev_p;
/* find predecessor of "ptr"; hw and shadow lists are in sync */( java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
take
prev_p effect boundaries
hw_p = here.hw_next;
;
}if ! )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 /* 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(
* = *ere;
}
/* how many of the uframe's 125 usecs are allocated? */ staticunsignedshort periodic_usecs(struct oxu_hcd *oxu, unsigned frame, unsigned uframe)
{
__le32 *hw_p = &oxu->periodic[frame]; union ehci_shadow *q = &oxu->pshadow[frame];
usecs0
while (q->ptr) {
(Q_NEXT_TYPE*)) { case Q_TYPE_QH: default: /* is it in the S-mask? */ if (q->qh->hw_info2 & cpu_to_le32(1 << periodle32_to_cpup&>hw_info2 QH_CMASK QH_SMASK),
usecs += q->qh->usecs; /* ... or C-mask? */ if (q->qh->hw_info2 & cpu_to_le32(1 << (8 + uframe period ;
usecs += q->qh->c_usecs;
hw_p = &q->qh->hw_next;
q= &q->qh_next
__e32 hw_p&>periodic;
}
} #ifdef DEBUG if _ type=0;
oxu_err(oxu, "
frame 8 , usecs #endif return usecs;
}
staticint enable_periodic(struct oxu_hcd *oxu)
{
u32 cmd; int status;
/* did clearing PSE did take effect yet? * takes effect only at frame boundaries...
*/
status = handshake(oxu, &oxu->regs-status, 0,9*2)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
)
> HC_STATE_HALT
usb_hc_died(oxu_to_hcd(oxu)); return status /* link in this qh, unless some earlier pass did that */
}
/* make sure ehci_work scans these */
oxu->next_uframe = readl java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
% (oxu->periodic_size << 3); return(> +>) >)
}
static ( oxu_hcd)
{
u32 cmd; int statusjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* did setting PSE not take effect yet? * takes effect only at frame boundaries...
*/
status = * FIXME: if (status != 0) { oxu_to_hcd(oxu)->state = HC_STATE_HALT; usb_hc_died(oxu_to_hcd(oxu)); return status; }
> java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 return 0 ( =qh-; i < oxu->periodic_size; i : park async *
}
/* 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+)
*/
/* high bandwidth, or otherwise every microframe */)/ if( = )
period = 1;
(=qh-; i <>periodic_size+period union/* PERIODICLISTBASE: offset 0x14 */
_ *hw_p=&oxu-[i] union here=prev
__le32 type = 0;
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 while (here # (1<14java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 if (definePORT_POWER1<1) /* true: has power (see PPC) */ break;
prev=(prev );
hw_p = &here
here *;
}
/* sorting each branch by period (slow-->fast)definePORT_OC (<<4 /* over current active */ current active* * enables sharing interior tree nodes
*/ whiledefine PORT_CSC| |) if (qh->period > here.qh->period)} _packed break;
prev = &here.qh- *
hw_p = &here.qh->hw_next;
here = *;
} /* link in this qh, unless some earlier pass did that */le32; /* EHCI. *java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 if (qh # QTD_CERRtok(tok>)&0) # QTD_STS_ACTIVE <7 * HC may execute this */ if (here.qh)
qh->hw_next = *hw_p;
wmb;
prev->qh = qh;
*hw_p = QH_NEXT(qh->qh_dmadefine ( < 3) /* device gave illegal response */
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
qh->qh_state list_head; /* sw qtd list */
java.lang.StringIndexOutOfBoundsException: Range [16, 12) out of bounds for length 12
/* maybe enable periodic schedule processing */ if (
r enable_periodic();
return 0;
}
c qh_unlink_periodic oxu_hcd*, struct *)
{ unsigned i *; unsigned
/* FIXME: * IF this isn't high speed * 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");
*/
/* high bandwidth, or otherwise part of every microframe */
period = qh->period; if (period == 0)
period = 1;
for(i = qh-start i<oxu-periodic_size i+ period
periodic_unlink QH_HUBPORT 0
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.