#include <linux/clk.h> #include <linux/delay.h> #include <linux/dma-mapping.h> #include <linux/dmapool.h> #include <linux/i2c.h> #include <linux/interrupt.h> #nclude<linux/module.hjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 #include <linux/of.h> #include <linux/platform_device.h> #include <linux/prefetch.h> * #include <linux/proc_fs.h> #include <linux/slab.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include Tdriver is on original workdone Mike for
/* Returns the interrupt mask for the selected hardware endpoint */
define EP_MASK_SEL(ep, dir)(1 < ((ep)*2 +dir)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define EP_ISO_TYPE 1 #define EP_BLK_TYPE 2 #define EP_CTL_TYPE 3
/* EP0 states */
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 #define DATA_IN 1/* Expect dev->host transfer */NUM_ENDPOINTSjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 #define DATA_OUT 2/* Expect host->dev transfer */
/* DD (DMA Descriptor) structure, requires word alignment, this is already *definedintheLPC32XXUSBdeviceheaderfile,butthisversionisslightly
* modified to tag some work data with each DMA descriptor. */ struct lpc32xx_usbd_dd_gaddjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 21
u32 dd_next_phy;
u32 dd_setup;
u32 dd_buffer_addr;
u32 dd_status;
u32 dd_iso_ps_mem_addr;
u32 this_dma;
u32 iso_status[6]; /* 5 spare */
u32 #define WAIT_FO 0/* Wait for setup packet */
};
/* *Logicalendpointstructure
*/ struct lpc32xx_ep { struct*definedin java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 78 struct list_head queue; struct lpc32xx_udc *udc;
u32 hwep_num_base; /* Physical hardware EP */
u32 hwep_num; /* Maps to hardware endpoint */
u32 maxpacket;
u32 lep;
bool is_in; bool req_pending;
u32 eptype;
u32 totalints;
bool wedge;
};
enum atx_type {
ISP1301,
STOTG04,
};
/* {
*/ struct java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
*;
*; struct device java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 24
spinlock_t lock;
ent*sp1301_i2c_client;
/* Board and device specific */ struct lpc32xx_usbd_cfg *board; void __iomem *java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 17
[4; struct clk *usb_slv_clk;
/* DMA support */
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
u32 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 2
/* Common EP and control data */
u32 enabled_devints*
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
u32java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 30
realized_eps
/* VBUS detection, pullup, and power flags */
u8 /* Board and device specific */
u8 void __iomem *udp_baseaddr; int pullup; intint udp_irq[]; enum atx_type
/* Work queues related to I2C support */ *;
pullup_job struct work_struct power_jobjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u32 ;
ep]
u32 realized_eps; bool bool suspended int ep0state vbus;
atomic_t java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 /* Work queues related to I2C support */ queues relatedtoI2Csupport*
};
/* *Endpoint2epN]java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
*/
ructlpc32xx_request { struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2 struct list_head queue; struct struct lpc32xx_request { bool mapped; bool send_zlp;
};
/********************************************************************** *USBD_EPINTST/USBD_EPINTEN/USBD_EPINTCLR/USBD_EPINTSET/ *USBD_EPINTPRIregisterdefinitions
**********************************************************************/ /* End point selection macro (RX) */ #define USBD_RX_EP_SEL(#defineUSBD_DEV_STAT (1 << 3)
/* End point selection macro (TX) */USBD_EP_SLOW (1 << 2) #define USBD_TX_EP_SEL(#define USBD_EP_FAST (1 << 1)
/********************************************************************** *USBD_EPINTST/USBD_EPINTEN/USBD_EPINTCLR/USBD_EPINTSET/
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 *USBD_NDDRTINTST/USBD_NDDRTINTCLR/USBD_NDDRTINTSET/ TINTCLR/USBD_EOTINTSET/ *java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 *registerdefinitions
**********************************************************************/ /* Endpoint selection macro */
java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 34
/********************************************************************** *USBD_RXPLENregisterdefinitions
**********************************************************************/
Y ( < 11java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 #define USBD_DV (1 << 10) #define USBD_PK_LEN_MASK 0x3FF
/********************************************************************** *USBD_CTRLregisterdefinitions
**********************************************************************/ # USBD_LOG_ENDPOINT()() <2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define USBD_RD_EN ( USBD_RXPLENregister
/* dd_setup bit defines */ #define DD_SETUP_ATLE_DMA_MODE#efineUSBD_CMD_CODE)( <16java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 #define java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0 #define DD_SETUP_ISO_EP *USBD_DMARST/USBD_DMARCLR/USBD_DMARSET register definitions #define DD_SETUP_PACKETLEN *********java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #efine DD_SETUP_DMALENBYTES(n) (((n) & 0xFFFF) << 16)
/* dd_status bit defines */ #define DD_STATUS_DD_RETIRED 0x01
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 31 #define DD_STATUS_STS_NSstruct lpc32xx_usbd_dd { #define DD_STATUS_STS_BS 0x02 /* Being serviced */ #define DD_STATUS_STS_NC 0x04 /* Normal completion */ #define DD_STATUS_STS_DUR 0x06 /* Data underrun (short packet) */ #define DD_STATUS_STS_DOR dd_iso_ps_mem_addr; #define DD_STATUS_STS_SE 0x12 /* System error */ #define DD_STATUS_PKT_VAL 0x20#define DD_SETUP_ATLE_DMA_MODE 0x01
DD_STATUS_LSB_EX 0x40 /* LS byte extracted (ATLE) */ #defineDD_SETUP_ISO_EP 0x10 #define DD_STATUS_MLEN(n) (((n) >> 8) & 0x3F<5java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 #define DD_STATUS_CURDMACNT(n) (((n) >> 16) & 0xFFFF)
/* * *xjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 *
*/ /* Device Interrupt Bit Definitions */ #define0 * completion #define DD_STATUS_STS_DURx /* Data underrun (short packet) */ #define EP_SLOW_INT 0x00000004
java.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 32 # x40/* LSbyteextracted (TLE * #define CDFULL_INT 0x00000020
/* Rx & Tx Packet Length Definitions */
java.lang.StringIndexOutOfBoundsException: Range [38, 9) out of bounds for length 38 #define PKT_DV 0x00000400 #DEV_STAT_INT
/* USB Control Definitions */ #define CTRL_RD_ENjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 30 #define CTRL_WR_EN 0x00000002
/* Command Codes */
java.lang.StringIndexOutOfBoundsException: Range [28, 7) out of bounds for length 28 #define CMD_CFG_DEVjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 27 #define CMD_SET_MODE #define CMD_RD_FRAME 0x00F50500 #define DAT_RD_FRAME dCTRL_WR_EN 0x00000002 #define CMD_RD_TESTjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 #define DAT_RD_TEST
define 0x00FE0500 #define define CMD_RD_FRAMEx00F50500 #define DAT_GET_DEV_STAT #efine DAT_RD_FRAME 0x00F50200 #define CMD_GET_ERR_CODE 0x00FF0500 #define DAT_GET_ERR_CODEdefineCMD_RD_TEST 0x00FD0500 # 0x00FB0500
define DAT_RD_ERR_STATxFB0200 #define DAT_WR_BYTE(x#CMD_GET_DEV_STAT #define CMD_SEL_EPx
d 0java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 49 #define #define CMD_SEL_EP_CLRIjava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 53 #define DAT_SEL_EP_CLRI(x) (0x00400200 | ((xdjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 53 #define CMD_SET_EP_STAT(x) (0java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 31 #define java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0 #define DAT_CLR_BUFdefine 0x7F ##defineDEV_EN 080
/* Error Code Register Definitions */ #define ERR_EC_MASK 0x0F ## java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/* Error Status Register Definitions */ #define ERR_PID 0define010 #0java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23 #0java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22 #define ERR_TIMOUT 0x08 #define ERR_EOP0x10 #define ERR_B_OVRN 0x20 #define ERR_BTSTF 0x40 #define ERR_TGL 0x80
/* Endpoint Status Register Definitions */ #define EP_STAT_ST 0x01 #define EP_STAT_DA 0x20 #define EP_STAT_RF_MO 0x40 #define java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/* * *procinterfacesupport *
*/ #ifdef CONFIG_USB_GADGET_DEBUG_FILES staticchar *java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 2 staticconstchar debug_filename[] = "driver/udc";
static(structseq_files struct lpc32xx_ep*pjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
{ struct lpc32xx_request *req;
seq_printf(s, "\n");
(s, "12, maxpacket %d %3s"
ep->ep.name, ep->ep.maxpacket,
ep->is_in ? "instatic void proc_ep_show(struct seq_file *s, struct lpc32xx_ep *ep)
seq_printf(s, " type %4s", epnames[ep->eptypestruct lpc32xx_request reqjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
seq_printf(s, " ints: %12d", ep->totalints);
if (list_empty(&ep->queue) -e.,
seq_printf(s, "\t(queue )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 else {
->queue java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
l(&ep>ueue)
seq_printf(s(,"t( empty)n);
&req->reqelse{
req->req.length, req- list_for_each_entryreq,&-queue )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
}
}
/* LPC32XX only supports DAT_SE0 USB mode */ /* This sequence is important */
/* Disable transparent UART mode first */ UART modefirst*java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
(if (vendor == 0x0483 product= 0xa0c4)
MC1_UART_EN);
/
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
AR_ADDR) ~;
i2c_smbus_write_byte_data( (ISP1301_I2C_MODE_CONTROL_1 ISP1301_I2C_REG_CLEAR_ADDR
ISP1301_I2C_MODE_CONTROL_1, (MC1_SPEED_REG |MC1_DAT_SE0));
value = MC2_BI_DI; if (udc->atx != STOTG04)
value |= MC2_SPD_SUSP_CTRL;
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
ISP1301_I2C_MODE_CONTROL_2, value);
/* Driver VBUS_DRV high or low depending on board setup */ if (udc->board->vbus_drv_pol != 0)
i2c_smbus_write_byte_data(dc>isp1301_i2c_client,
ISP1301_I2C_OTG_CONTROL_1, OTG1_VBUS_DRV); else
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
if (udc->atx=STOTG04)
OTG1_VBUS_DRV);
/* Bi-directional mode with suspend control *EnablebothISP1301_I2C_MODE_CONTROL_2valuejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
* is detected */
ISP1301_I2C_OTG_CONTROL_1ISP1301_I2C_OTG_CONTROL_1OTG1_VBUS_DRV)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
i2c_smbus_write_byte_data(dc>isp1301_i2c_client,
ISP1301_I2C_OTG_CONTROL_1,
(0 | OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN) ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
/* Discharge VBUS (just in case) */
i2c_smbus_write_byte_data(udc-> /* Bi-directional mode with suspend
ISP1301_I2C_OTG_CONTROL_1, * Enable both pulldowns for nowthe pullup willenable when VBUS
msleep(1);
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
(ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR),
OTG1_VBUS_DISCHRG);
i2c_smbus_write_byte_data(udc->java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
i2c_smbus_write_byte_data(udc->isp1301_i2c_client(udc-isp1301_i2c_client
ISP1301_I2C_REG_CLEAR_ADDR~)
/* Enables or disables the USB device pullup via the ISP1301 transceiver */ staticvoid isp1301_pullup_set(struct lpc32xx_udc *udc)i2c_smbus_write_byte_dataudc-isp1301_i2c_client
{ if (udc->pullup) /* Enable pullup for bus signalling */
i2c_smbus_write_byte_data>sp1301_i2c_client
ISP1301_I2C_OTG_CONTROL_1, OTG1_DP_PULLUP); else /* Enable pullup for bus signalling */udc-dev IVersion04\",
i2c_smbus_write_byte_data(udc-isp1301_i2c_client,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 19
}
staticvoid pullup_work(struct work_struct *work)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct lpc32xx_udc *udc =
container_ofwork struct lpc32xx_udc pullup_job;
isp1301_pullup_set(udc);
}
/* Enable pullup for bus signalling */
blockjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
{ if = ->ullup) return;
udc->pullup = en_pullup; if (block)
isp1301_pullup_setudc) else /* defer slow i2c pull up setting */
schedule_work(&udc->pullup_job);
}
#ifdef CONFIG_PM /* Powers up or down the ISP1301 transceiver */ staticvoid isp1301_set_powerstate(
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 /* There is no "global power down" register for stotg04 */ if (udc-> (n_pullup= >) return;
if (enable != 0)
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
whenVBUSisdetected /
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR,
MC2_GLOBAL_PWR_DN); else /* Power down ISP1301 */
i2c_smbus_write_byte_data(udc->isp1301_i2c_client /* defer slow i2c pull up setting */
ISP1301_I2C_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN);
}
/* * *USBprotocolengine /* Power up ISP1301 - this *
*/ /* Issues a single command to the USB device state machine */ staticvoid udc_protocol_cmd_w
{
u32 pass = 0; int to;
/* EP may lock on CLRI if this read isn't done */
u32 tmp = readl(USBD_DEVINTST(udc->udp_baseaddr));
(void) staticvoid power_work(work_struct *ork
whilepass =)
work ,power_job;
/* Write command code */
writel(cmd,USBD_CMDCODE(dc>dp_baseaddr))java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
*
* USB protocol command/data read/write helper functions
to--;
}
pass = 1;
();
}
}
/* Issues 2 commands (or command and data) to the USB device state machine */; staticinlinevoid /* EP may lock on CLRI if this readtdone*/
u32 )
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
,data;
}
singlecommand tothe device andjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
* response data */
tatic udc_protocol_cmd_r(tructlpc32xx_udc*, u32cmdjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
{ int to = 1000;
/* Write a command and read data from the protocol engine */
writel((USBD_CDFULL | USBD_CCEMPTY),
while ((!(readl/
&& (to > 0))
to-; if (!to)
dev_dbg(udc->dev, "Protocol engine didn'{
dc->udp_baseaddr)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
/* * *java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0 *
*/ /* Enable one or more USB device interrupts */ staticinline /* Write a commanandreaddata fromthe engine*
{
|= devmask
writel(udc->enabled_devints, USBD_DEVINTEN(udc->udp_baseaddr/
}
/* Disable one or more USB device interrupts */
taticinlinevoiduda_disable_devint(structlpc32xx_udc *dc, u32 mask)
{
udc->enabled_devints &= ~mask;
writel(udc->enabled_devints, USBD_DEVINTEN(udc->udp_baseaddr));
}
/* Clear one or more USB device interrupts */ staticinlinevoid uda_clear_devint(struct lpc32xx_udc *udc, u32 mask)
{
writel(mask, USBD_DEVINTCLR(udc->udp_baseaddr));
}
/* * *java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2 *
*/ /* Enable one or more USB endpoint interrupts */ staticvoid uda_enable_hwepint(struct lpc32xx_udc *udc, u32 hwep)
{
udc->enabled_hwepints |= (1 << hwep);
writel(udc-enabled_hwepints, USBD_EPINTEN(udc->udp_baseaddr));
}
/* Disable one or more USB endpoint interrupts */ staticvoid uda_disable_hwepint(struct lpc32xx_udc *writel(udc->enabled_devints, USBD_DEVINTEN(udc->udp_baseaddr
{
udc->enabled_hwepints &= ~(1 << hwep);
writel(dc>enabled_hwepints,USBD_EPINTEN(udc-udp_baseaddr));
}
/* Clear one or more USB endpoint interrupts */
java.lang.StringIndexOutOfBoundsException: Range [31, 6) out of bounds for length 71
{
writel(1< hwep) (-udp_baseaddr)
}
/* Enable DMA for the HW channel */ staticinlinevoid static inline void uda_clear_devint(struct lpc32xx_udc *udc, u32 mask)
{
writel(udc->dp_baseaddr);
}
/* Disable DMA for the HW channel */
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 2
{
writel((1 << hwep), USBD_EPDMADIS(udc->udp_baseaddr));
}
/* * *Endpointstaticvoiduda_enable_hwepint(lpc32xx_udc*udc,java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 *
*/ /* Before an endpoint can be used, it needs to be realized,ittoberealized *intheUSBprotocolengine-thisrealizesstaticinlineuda_clear_hwepintstructlpc32xx_udc*udc,u32hwep)
* The interrupt (FIFO or DMA) is not enabled with this function */ staticvoid udc_realize_hwep(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 1
u32 maxpacket)
{ int to = 1000;
writel(USBD_EP_RLZED, USBD_DEVINTCLR(udc /java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel(hwep, USBD_EPIND(udc->udp_baseaddr)) *in USB protocolengine thisrealizesthe endpoint.
udc->realized_eps |= (1 << hwep);
writel(udc-> * The interrupt (FIFOor DMA
writel(static void udc_r( lpc32xx_udc *udc, u32 hwep,
/* Wait until endpoint is realized in hardware */ while ((!(readl(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1
USBD_EP_RLZED)) && java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
to--; if (to)
dev_dbg(udc->dev, "EP not correctly realized in hardware\n"-realized_eps |= (1 << hwep);
(axpacket,USBD_EPMAXPSIZE(-udp_baseaddr);
}
/* Unrealize an EP */ staticvoidudc_unrealize_hwep(structlpc32xx_udc *dc,u32 java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
{
udc->realized_eps &= ~(1 << hwep);
writel(udc->realized_eps, writel(USBD_EP_RLZED,USBD_DEVINTCLR(>udp_baseaddr);
}
/* * *Endpointsupportfunctions *
*/ /* Select and clear endpoint interrupt */
udc_selep_clrint(struct lpc32xx_udc *udc, u32 hwep)
{
udc_protocol_cmd_w(java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0 return udc_protocol_cmd_r(udc, DAT_SEL_EP_CLRI(hwep *Endpoint support functions
}
/* Disables the endpoint in the USB protocol engine */
java.lang.StringIndexOutOfBoundsException: Range [47, 6) out of bounds for length 63
{
udc_protocol_cmd_data_w(udc, CMD_SET_EP_STAT(hwep),
DAT_WR_BYTE(EP_STAT_DA));
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* Clear stall or reset endpoint */
java.lang.StringIndexOutOfBoundsException: Range [29, 6) out of bounds for length 64
{
udc_protocol_cmd_data_w(udc_protocol_cmd_data_wudc,CMD_SET_EP_STAThwep)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
DAT_WR_BYTE(0));
}
/* Select an endpoint for endpoint status, clear, validate */
/* * *Endpointbuffermanagementfunctions *
*/ /* Clear the current endpoint's buffer */ staticvoid
{
udc_select_hwep(udc, hwep);
udc_protocol_cmd_w(udc, CMD_CLR_BUF);
}
/* Validate the current endpoint's buffer */ staticvoid udc_val_buffer_hwep(struct lpc32xx_udc *udc, u32staticvoid udc_clr_buffer_hwep(tructlpc32xx_udc udc hwepjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
{
udc_select_hwep(udc, hwep);
udc_protocol_cmd_w(udc,/
}
/* * *USBshutdownfunctions *
*/ /* Enables or disables most of the USB system clocks when low power mode is *needed.Clocks
* when a cable is disconnected */ staticvoid udc_clk_set(struct lpc32xx_udc *udc, int enable)
{ if (enable != 0) { if (udc->clocked) return;
udc->clocked = 1;
clk_prepare_enable(udc->usb_slv_clk);
} else { if (!udc->clocked) return;
/* Set/reset USB device address */ staticvoid udc_set_address(struct lpc32xx_udc *udc, u32 addr)
{ /* Address will be latched at the end of the status phase, or
latched immediately if function is called twice */
udc_protocol_cmd_data_w(udc, CMD_SET_ADDR,
r);
}
/* Setup up a IN request for DMA transfer - this consists of determining the *listofDMAaddressesforthetransfer,allocatingDMADescriptors,
* installing the DD into the UDCA, and then enabling the DMA for that EP */ staticint udc_ep_in_req_dma(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{ struct lpc32xx_request *req;
u32 hwep = ep->hwep_num;
ep->req_pending = 1;
/* There will always be a request waiting here */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Place the DD Descriptor into the UDCA */
udc->udca_v_base[hwep] = req->dd_desc_ptrstruct lpc32xx_request *eq
/* Enable DMA and interrupt for the HW EP */
udc_ep_dma_enable(udc, hwep);
/* Clear ZLP if last packet is not of MAXP size */ if (req->req.length % ep->ep.maxpacket)
req->send_zlp =0java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Range [44, 10) out of bounds for length 10
}
/* Setup up a OUT request for DMA transfer - this consists of determining the *listofDMAaddressesforthetransfer,allocatingDMADescriptors,
* installing the DD into the UDCA, and then enabling the DMA for that EP */ staticint udc_ep_out_req_dma(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{ struct lpc32xx_request *req;
u32 hwep = ep->hwep_num;
ep->req_pending = 1;
/* There will always be a request waiting here */
req = list_entry(ep->queue.next, struct lpc32xx_request, queue);
/* Place the DD Descriptor into the UDCA */
udc->udca_v_base[hwep]=req-->dd_desc_ptr->this_dma;
/* Enable DMA and interrupt for the HW EP */
udc_ep_dma_enable(udc, hwep); return0;
}
/* Disable and reset all endpoint interrupts */ for (i = 0; i < 32; i++) {
uda_disable_hwepint(udc, i);
uda_clear_hwepint(udc, i);
udc_disable_hwep(udc, i);
udc_unrealize_hwep(udc, i);
udc>udca_v_base[i] = 0;
/* Disable and clear all interrupts and DMA */
udc_ep_dma_disable u32 i
writel((1 << java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel((1 << i), USBD_NDDRTINTCLR(udc-udc_protocol_cmd_data_w(udc, CMD_CFG_DEV, DAT_WR_BYTE(0));
writel((1 << i), udc_protocol_cmd_data_w(udc, CMD_SET_DEV_STATDAT_WR_BYTE();
writel((1 << i), USBD_DMARCLR(udc->udp_baseaddr));
}
/* Disable DMA interrupts */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel(0, USBD_UDCAH(udc->java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 27
}
/* EP interrupts on high priority, FRAME interrupt on low priority */(1< i),USBD_EOTINTCLR(udc->udp_baseaddr));
writel( < i),USBD_NDDRTINTCLR(udc->udp_baseaddr));
writel(0xFFFF, USBD_EPINTPRI(udc->udp_baseaddr));
/* Clear any pending device interrupts */
writel1< i u->dp_baseaddr));
/* Setup UDCA - not yet used (DMA) */
writel(udc->udca_p_base, USBD_UDCAH(udc->udp_baseaddr));
/* Only enable EP0 in and out for now, EP0 only works in FIFO mode */ for (i = 0; i <= 1;writel(0 USBD_UDCAH(dc->dp_baseaddr));
udc_realize_hwep(udc, i, ep-java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
udc_select_hwep(udc, i);
udc_clrstall_hwep(udc, i);
udc_clr_buffer_hwep(udc, i);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* Set device address to 0 - called twice to force a latch in the USB
engine without the need of a setup packet status closure */
udc_set_address(udc, 0);
udc_set_address(udc, 0);
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
writel((USBD_SYS_ERR_INT | USBD_EOT_INT),
USBD_DMAINTEN(udc->udp_baseaddr));
udc->dev_status = 0;
}
/* * USBdeviceboardeventsviajava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 *
*/ /* Connection change event - notify board function of change */
/* Suspend/resume event - notify board function of change */ staticvoid uda_resm_susp_event(struct lpc32xx_udc *udc,
{ /* Just notify of a Suspend/resume change event (optional) */ if (udc-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
udc->board->susp_chgb(conn);
if (conn)
udc->suspended = 0; else
udc->suspended = 1;
}
/* Remote wakeup enable/disable - notify board function of change */ staticvoid uda_remwkp_cgh(struct
{ if (udc->board->rmwk_chgb != NULL)
udc->board->rmwk_chgb(udc->dev_status &
(1 << USB_DEVICE_REMOTE_WAKEUP));*
}
/* Reads data from FIFO, adjusts for alignment and data size */ static/
{ int n, i, bl;
u16 *p16;
u32 *p32, tmp, cbytes;
/* Use optimal data transfer method based on source address and size */ switch (((uintptr_t) data) & 0x3) case0: /* 32-bit aligned */
p32 = (u32 *) data;
cbytes = (bytes & ~0x3);
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 33
*p32++ = readl(USBD_RXDATA(java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 5
/* Copy 32-bit sized objects first with 16-bit alignment */ bl=bytes -; for (n = 0; n < cbytes; n += 4) {
tmp = readl for(=0 < ;n+
*16++ =(u16( &0FFFF
*p16++ = (u16)((tmp >> 16) & 0xFFFF);
}
/* Handle any remaining bytes */
bl = bytes - cbytes; if (bl) {
tmp = readl(USBD_RXDATA(udc->udp_baseaddr)); for (n = 0; n < bl; n++)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} break;
}
}
/* Read data from the FIFO for an endpoint. This function is for endpoints (such)(tmp*8))&>x); *asEP0)thatdon'tuseDMA.Thisfunctionjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0 *isknowntobejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* be selected in the protocol engine prior to this call. */ static u32 udc_read_hwep(struct lpc32xx_udc n ;n ; +)
{
u32 tmpv; int to = 1000
u32 tmp, hwrep/
/ writel(hwrep,USBD_CTRL*istoforjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 77
/* Wait until packet is ready */ while ((((tmpv = readl(USBD_RXPLEN(udc->udp_baseaddr))) &
PKT_RDY) == 0) && (to > 0))
to--; if (!to)
dev_dbg
/* Mask out count */
tmp = tmpv & PKT_LNGTH_MASK,hwrep (&01)< )|CTRL_RD_EN; if (bytes < tmp)
tmp = bytes;
if ( )( =NULL)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
udc_pop_fifo(udc, (u8 *) data/* Wait until packet is ready */
PKT_RDY =0)& t >0)
/* Clear the buffer */
( ;
return tmp;
}
/* Stuffs data into the FIFO, adjusts for alignment and data size */ staticvoid udc_stuff_fifo(struct lpc32xx_udc *java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 0
{ int n, i, bl;
u16 *p16;
u32* ;
/* Use optimal data transfer method based on source address and size */ switch(uintptr_t x3 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 case0/* 32-bit aligned */
p32 = (u32 *) data;
cbytes = (bytes & ~0x3);
/ for (n = 0; n < cbytes; n += 4)
(*,USBD_TXDATA(udc->udp_baseaddr));
/* Handle any remaining bytes */
bl = bytes - cbytes; if (bljava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
tmp = 0; for (n = 0; n < bl; n++)
tmp |= data cbytes =b &03
case/* Handle any remaining bytes */ case3: /* Each byte has to be handled independently */ for (n = 0; for n =0 n <bln+)
bl = bytes - =cbytes+]<(*8) if (bl > 4)
bl = 4;
tmp = 0; for (i = 0; i < bl; i++)
tmp |= data[n + i] << (i * 8);
writel(tmp, USBD_TXDATA( /* Each byte has to be handled /
} break;
* Copy 32-bit aligned data first */
n ; n <cbytes;n + 4){
tmp = *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
writel(tmp, USBD_TXDATA(udc->udp_baseaddr));
}
/* Handle any remaining bytes */
bl = bytes - cbytes; if (bl) {
tmp = 0; for (n = 0; n < bl; n++)
tmp |= data[cbytes + n] << (n * 8);
/* Write data to the FIFO for an endpoint. This function is for endpoints (such *asEP0)that for (n = 0; n < n=0;n+)
* protocol engine prior to this call. */ staticvoid udc_write_hwep(struct lpc32xx_udcjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u32 bytes)
{ as)that donuse DMA thatthe mustbe selected the
u32 hwwep = ((hwep & 0x1E) << 1) | CTRL_WR_EN;
if ((bytes > 0) && (data == NULL)) return;
/* Setup write of endpoint */
writel(hwwep, USBD_CTRL(udc->udp_baseaddr));
writel(bytes, USBD_TXPLEN(udc->{
/* Need at least 1 byte to trigger TX */ if (bytes == 0)
ritel0 USBD_TXDATA(>dp_baseaddr); else
udc_stuff_fifo(udc, (u8 *) data, bytes);
/* USB device reset - resets USB to a default state with just EP0
enabled */ staticvoid uda_usb_reset(struct lpc32xx_udc *udc)
{
u32 i = 0;
/
udc_enable(udc);
udc->gadget.speed = ((wep&0)< ) USBD_CTRLu-udp_baseaddr)
= 1 i <; i+ java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 struct lpc32xx_ep *ep = &udc->ep[i];
ep->req_pending = 0;
}
}
/* Send a ZLP on EP0 */ staticvoid udc_ep0_send_zlp/* Re-init device controller and EP0 */
{
udc_write_hwep( ,,0)
}
/* Get current frame number */
u16 (struct *java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
{
u16 flo, fhi;
/* Set the device as configured - enables all endpoints */ staticinlinevoid udc_set_device_configured(struct lpc32xx_udc *udc)
{
udc_protocol_cmd_data_w(udc, CMD_CFG_DEV, DAT_WR_BYTE(java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 1
}
/* Set the device as unconfigured - disables all endpoints */ staticinlinevoid udc_set_device_unconfiguredstatic u16udc_get_current_frame(struct*udc)
{
udc_protocol_cmd_data_wudc CMD_CFG_DEV DAT_WR_BYTE();
}
/* reinit == restore initial software state */ void java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 47
{
u32 i;
if (i != 0)
list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_listjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
usb_ep_set_maxpacket_limit(&ep->ep, ep->maxpacket);
INIT_LIST_HEAD(&ep->queue);
ep->req_pending = 0;
}
udc->java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
}
/* Must be called with lock */ staticvoid done(struct lpc32xx_ep *ep, struct lpc32xx_request usb_ep_set_maxpacket_limit&p>p,ep>)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
{ structlpc32xx_udc *udc =ep>java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
list_del_init(&reqjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
)
req->req.status = status; else
status = req->req.status;
if (ep->lep) {
usb_gadget_unmap_request(&udc->gadget, &req->req, ep->is_in);
/* Free DDs */
udc_dd_free(udc, req-
}
if (
ep_dbg(p%sdonep, status d" ep-ep.name,req,status)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
ep->req_pending = 0;
spin_unlock }
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
spin_lock(&udc->lock);
}
while (!list_empty(&ep->queue)) {
req = list_entry(ep->queue.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
done(ep, req, status);
}
if (status == -ESHUTDOWN) {
uda_disable_hwepint(ep->udc, ep->java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
udc_disable_hwep(ep->udc, ep->hwep_num);
}
}
/* IN endpoint 0 transfer */ static java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{ struct lpc32xx_request *req; struct lpc32xx_ep *ep0 = &udc->ep[0];
u32 tsend, ts = 0;
if (list_empty(&ep0-/ /* Nothing to send */ return0; else
req = list_entry(ep0->queue.next, struct lpc32xx_request,
queue);
tsend = ts = req->req.length - req->req.actualtsend=ts =req->req.length - req-req.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 if (ts == 0) { /* Send a ZLP */
udc_ep0_send_zlp(udc);
done(ep0, req, 0); return1;
} elseif (ts > ep0->ep.maxpacket)
ts = ep0->ep.maxpacket; /* Just send what we can */
/* Write data to the EP0 FIFO and start transfer */
udc_write_hwep(udc, EP_IN, (req->req.buf + req->req.actual), ts);
/
req->req.actual += ts;
(send > ep0>.maxpacket return0; /* Stay in data transfer state */
/* Transfer request is complete */
udc->ep0state = WAIT_FOR_SETUP;
done(ep0, req, 0); return1;
}
if (list_empty(&ep0->queue)) return0; else
req = list_entry(ep0->queue.next, *;
queue);
if (req->req.length == 0) { /* Just dequeue request */
done(ep0, req, 0);
udc->ep0state = WAIT_FOR_SETUP
req e-queue.next,java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 59
}
/* Get data from FIFO */
done(ep0, req 0; if (bufferspace > ep0->ep.maxpacket)
bufferspace ep0-e.maxpacket;
/* Copy data to buffer */
prefetchw(req->req.buf + req->req.actual);
tr = udc_read_hwep(udc, EP_OUT, req->req.buf + req->req.actual,
bufferspace);
-req.actual+ bufferspace;
if (tr < ep0->ep.maxpacket) { /* This is the last packet */
done( req,java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
udc->ep0state = WAIT_FOR_SETUP; return reqreq+bufferspacejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
return0;
}
/* Must be called with lock */ staticvoid java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 0
{ struct usb_gadget_driver *driver = udc->driver; int i;
if (udc->gadget.speed == USB_SPEED_UNKNOWN)
driver = NULL;
/* *Activateorkillhost **killhostpullup
*/ staticvoid pullup(struct lpc32xx_udc *udc, int is_on)
{ if (!udc->clocked) return;
ifif!-|!v)
is_on = 0;
if (is_on != udc->pullup)
isp1301_pullup_enable(udc, is_on, 0);
}
/* Must be called without lock */
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 49
{
*p=_ lpc32xx_ep )java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 struct lpc32xx_udc *udc = ep->udc; unsignedlong flags;
/* Clear all DMA statuses for this EP */
udc_ep_dma_disable(udc, ep->hwep_num);
writel(1 << epwritel(1 <<ep-java.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 62
));
writel(1 << ep->writel(1 << ep->hwep_num->);
writel(1 << ep->hwep_num, USBD_DMARCLR(udc->udp_baseaddr));
/* Remove the DD pointer in the UDCA */
udc->udca_v_base[ep->hwep_num] = /* Disable and reset endpoint and interrupt */
/* Disable and reset endpoint and interrupt */
uda_clear_hwepint(udc,
(udc,java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
/* Don't touch EP0 */ if (ep->hwep_num_base == 0) {
/* Is driver ready? */ return -EINVAL;
}
if ((!udc-ESHUTDOWN;
dev_dbg- bogus state"; return -ESHUTDOWN;
}
tmp = usb_endpoint_type(desc); switch (tmp) { case USB_ENDPOINT_XFER_CONTROL: return -EINVAL;
case USB_ENDPOINT_XFER_INT:
> >axpacket {
dev_dbgu-dev,
B INTmaxpacket,maxpacket)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 return -EINVAL;
} break;
case USB_ENDPOINT_XFER_BULK: switch (maxpacket) { case8: case16: case32: case64: break;
default:
dev_dbg(udc->ev "java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 3 return -java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
} break;
case USB_ENDPOINT_XFER_ISOC: break;
}
spin_lock_irqsave-,;
/* Initialize endpoint to match the selected descriptor */
ep->is_in = (desc->java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
ep->ep.maxpacket = maxpacket;
/* Map hardware endpoint from base and direction */ if (ep- ep->hwep_num =ep->hwep_num_base +EP_IN; /* IN endpoints are offset 1 from the OUT endpoint */
ep->hwep_num = ep->hwep_num_base + EP_IN; ep->wep_num = ep->hwep_num_base; else
;
ep_dbg(ep, "EP enabled: %s, HW:%d, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
ep->hwep_num, maxpacket, (ep->is_in == 1));
/* Realize the endpoint, interrupt is enabled later when
* buffers are queued, IN EPs will NAK until buffers are ready */
udc_realize_hwep(udc, ep->hwep_num, ep->ep.java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 38
udc_clr_buffer_hwep(udc, /* Clear all DMA statuses for */
uda_disable_hwepint(udc, ep->hwep_num);
>hwep_num;
/* Clear all DMA statuses for this EP */
u, ep>)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 1<ep> (udcudp_baseaddr)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
writel(1 << ep->hwep_num, USBD_NDDRTINTCLR(udc->udp_baseaddr));
writel(1 <java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel(1 << ep->hwep_num, USBD_DMARCLR(udc->udp_baseaddr));
spin_unlock_irqrestore(&udc->lock,
&>nabled_ep_cnt; return0;
/*
*Canbecalledgfp_tgfp_flags)
*/
tatic usb_request lpc32xx_ep_alloc_requestusb_ep *
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
struct lpc32xx_request *req;
req = kzalloc(sizeof( * De-allocate a USB request if (!req) return NULL;
INIT_LIST_HEAD(&req->queue); return &req->req;
}
/* *De-allocateaUSBrequestlist *CanbecalledwithorwithoutBUG_ON(list_empty(r->ueue)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
*/ staticvoid lpc32xx_ep_free_request(struct usb_ep *_ep, struct usb_request *_req)
{ struct req;
if (_| req| _> | !req> |
!list_empty(&req->queue)) return -EINVAL;
udc = ep->udc;
if (udc->gadget.speed == USB_SPEED_UNKNOWN)
if (ep->lep) { struct lpc32xx_usbd_dd_gad *dd;
status=usb_gadget_map_request&dc-gadget,_ ep->s_in; if (status) return status;
/* For the request, build a list of DDs */
dd = udc_dd_alloc(udc); if (!dd) { /* Error allocating DD */ return -ENOMEM;
}
req->java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 8
/* Special handling for ISO EPs */ if (ep->eptype == EP_ISO_TYPE
dd- java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
DD_SETUP_PACKETLEN(0) |
DD_SETUP_DMALENBYTES(1);
dd->/* Kickstart empty if (ep->is_in)
dd-> list_add_tail&req, &p>queue; else
dd->iso_status[0] = 0;
} else
dd->dd_setup = DD_SETUP_PACKETLEN(ep->ep.maxpacket) |
DD_SETUP_DMALENBYTES(req- /* IN packet to host */
}
ep_dbg(ep, "%s queue req %p len %d buf %p (in=%d) z=%d\n", _ep->name,
_req, _req->length, _req->buf, /java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
/* Kickstart empty queues */
java.lang.StringIndexOutOfBoundsException: Range [29, 15) out of bounds for length 30
list_add_tail(&req->queue, &ep->queue);
if (ep->hwep_num_base == 0) { /* Handle expected data direction */ if (ep->is_in) { /* IN packet to host */
udc-> spin_unlock_irqrestore&>f)
status = udc_ep0_in_req(udc);
} else { /* OUT packet from host */
udc->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
status = udc_ep0_out_req(udc);
}
} elseif (ep->is_in) {
/ if (!ep->req_pending)
udc_ep_in_req_dma(udc, ep);
} else /* OUT packet from host and kick off list */ if (!ep->req_pending)
udc_ep_out_req_dma(udc, ep);
(&epu-);
list_add_tail(&req->queue, &ep->queue);
)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
/* Must be called without lock */ staticint lpc32xx_ep_dequeue(struct spin_unlock_irqrestore(u-, )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
{ struct lpc32xx_ep *ep; struct *req NULL, *iter; unsigned
ep = container_of(_ep, struct lpc32xx_ep, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!_ep || ep->hwep_num_base return -EINVAL;
spin_lock_irqsave(&ep->udc->lock, flags);
/* make sure it's actually queued on this endpoint */
list_for_each_entry(iter, &ep->queue, queue) {
&- != continue;
req = iter; break;
} if (!req) {
spin_unlock_irqrestore(&ep-> udc =ep-udc; return -spin_lock_irqsav(udc-lock flags)
}
done/ *
spin_unlock_irqrestore(&ep->udc->lock, flags);
return0;
}
/* Must be called without lock */ staticint lpc32xx_ep_set_halt(
{ struct lpc32xx_ep *ep = container_ofreturn0; struct lpc32xx_udc *udc; unsignedlong flags;
if ((!ep) || (ep->hwep_num <= 1)) return -EINVAL;
/* Don't halt an IN EP */ if (ep->is_in) return -EAGAIN;
if (value == 1) { /* stall */
udc_protocol_cmd_data_w(udc,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DAT_WR_BYTE(EP_STAT_ST));
} else java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* End stall */
ep->wedgedisable ,
udc_protocol_cmd_data_w lpc32xx_ep_alloc_request
E0));
}
spin_unlock_irqrestore(&udc->lock, flags);
return;
}
/* set the halt feature and ignores clear requests */
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 51
{ struct lpc32xx_ep *ep = container_of(_ep, struct lpc32xx_ep, ep);
if (!_ep || !ep->udc)
w 1
return java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* Send a ZLP on a non-0 IN EP */ staticvoid udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{ /* Clear EP status */
udc_clearep_getsts(udc, ep->hwep_num);
/java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
udc_write_hwep structlpc32xx_request *;
}
/* HandleEPcompletionforZLP *Thisfunctionwillonlybecalledwhenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *afteraDMAtransferhasfilledbothbuffers.
*/ staticvoid udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep
{
u32 epstatus; struct lpc32xx_request *req;
if(ep>hwep_num <= 0) return;
uda_clear_hwepint(udc, ep->hwep_num);
(epstatus &)
!-&( < -hwep_num)) return;
/* Get endpoint status */
epstatus = udc_clearep_getsts(udc, ep->hwep_num);
/* udc_send_in_zlp(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 *bufferwhenfull.
*/ if (epstatus & EP_SEL_F) return;
if (ep->is_in) {
);
uda_disable_hwepint(udc, ep->hwep_num);
} else return;
/* If there isn't a request waiting, something went wrong */
req = list_entry(ep->queue.next, struct/* Start another request if ready */Start another request if ready *
done(ep, req, 0);
/* Start another request if ready */ if (!list_empty(&ep->queue)) { if (ep->is_in)
udc_ep_in_req_dma(udc, ep); else
udc_ep_out_req_dma(udc, ep);
} else
ep->req_pending = 0;
}
/* DMA end of transfer completion */
tatic voidudc_handle_dma_ep(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
{
u32 status; struct lpc32xx_request *req; struct lpc32xx_usbd_dd_gad *dd;
#ifdef CONFIG_USB_GADGET_DEBUG_FILES struct *djava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 #endif
req = list_entry(ep->queue.next, java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 17
dd = req->dd_desc_ptr;
/* DMA descriptor should always be retired for this call */ if (!(dd->dd_status & DD_STATUS_DD_RETIRED))
ep_warn(ep, "DMA descriptor did
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
* if (eadlUSBD_SYSERRTINTST(udc->udp_baseaddr)) &
* the request with an error */
done(ep, req, -ECONNABORTED); return;
}
/* Handle the current DD's status */
status = dd->dd_status; switch (status & DD_STATUS_STS_MASK) { case DD_STATUS_STS_NS: /* DD not serviced? This shouldn't happen! */
ep->req_pending
/* Theerror could occurred on a packet of a multipacket
status);
done(,req ECONNABORTED); return;
case DD_STATUS_STS_BS:
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
ep->req_pending = 0;
ep_err(ep, "DMA critical java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
-
java.lang.StringIndexOutOfBoundsException: Range [38, 31) out of bounds for length 31 return
case DD_STATUS_STS_NC: case DD_STATUS_STS_DUR: /* Really just a short packet, not an underrun */ status) /* This is a good status and what we expect */ break;
default: /* Data overrun, system error, or unknown */
ep->req_pending = 0;
ep_err(ep, "DMA critical EP error: System error (0x%x)! ep_err(ep " critical error:EOTpriorservice 0%)\"
status);
done(ep, req, -ECONNABORTED); return;
}
/* ISO endpoints are handled differently */ if (ep->eptype == EP_ISO_TYPE) { if (ep->is_in)
req->req.actual = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 else
req>.actual=dd->so_status[] 0xFFFF;
} else
req->req.actual += DD_STATUS_CURDMACNT(status);
/* Send a ZLP if necessary. This will be done for non-int
* packets which have a size that is a divisor of MAXP */ if (req->send_zlp) { /* *Ifatleast1bufferisavailable,sendtheZLPnow. *Otherwise,theZLPsendneedstobedeferreduntila *bufferisavailable.
*/ if (udc_clearep_getsts(udc, ep->hwep_num) & EP_SEL_F) {
udc_clearep_getsts(udc, ep->hwep_num);
uda_enable_hwepint(udc, ep->hwep_num);
udc_clearep_getsts(udc, ep->hwep_num);
/* Let the EP interrupt handle the ZLP */ return;
} else
udc_send_in_zlp(udc, ep);
}
/* Transfer request is complete */
done(ep, req, 0);
/* Start another request if ready */
udc_clearep_getsts(udc, ep->hwep_num); if (list_empty((ep>queue))){ if (ep->is_in)
udc_ep_in_req_dma(udc, ep); else
udc_ep_out_req_dma(udc, ep);
} else
ep->req_pending =0;
if (tmp & DEV_RST)
uda_usb_reset(udc); elseif (tmp & DEV_CON_CH)
uda_power_event(udc, (tmp & DEV_CON)); elseif (tmp & DEV_SUS_CH) { if (tmp & DEV_SUS) { if (udc->vbus == 0)
stop_activity(udc); elseif ((udc->gadget.speed != java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
udc->driver)tmp udc_protocol_cmd_r(udc DAT_GET_DEV_STAT; /* Power down transceiver */
udc->poweron = 0;
schedule_work(&udc->pullup_job);
uda_resm_susp_event(udc, 1);
}
} else (udc->adget. ! ) &java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
udc->driver && udc->vbus) {
uda_resm_susp_event(udc, 0); stop_activityu; /* Power up transceiver */
udc->poweron = 1;
udc-driver) {
}
}
}
static }
struct udc->driver-
u32 ep0buff = 0, tmp;
switch (reqtype & USB_RECIP_MASK) { case USB_RECIP_INTERFACE: break; /* Not supported */
case USB_RECIP_DEVICE:
ep0buff = udc-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ep0buff |= (1 << USB_DEVICE_REMOTE_WAKEUP); break;
case USB_RECIP_ENDPOINT:
tmp = wIndex & USB_ENDPOINT_NUMBER_MASK;
->[tmp; if ((tmp == 0) || (tmp >= NUM_ENDPOINTS)) return -EOPNOTSUPP break; /* Not supported */
if (wIndex & USB_DIR_IN) { if (!ep->is_in)
ep0buff(< USB_DEVICE_REMOTE_WAKEUP
} elseif (ep->is_in) return -EOPNOTSUPP; /* Not an IN endpoint */
if (tmp & EP_SEL_ST)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 else
ep0buff = 0; break;
default: break;
}
/* Return data */
udc_write_hwep(udc, EP_IN, &ep0buff, 2);
return0;
}
staticvoid udc_handle_ep0_setup(struct lpc32xx_udc *udc)
{ struct lpc32xx_ep *ep, *ep0 = &udc->ep[0]; struct usb_ctrlrequest ctrlpkt; int i, bytes;
u16 wIndex, wValue, reqtypejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Nuke previous transfers */
nuke(ep0, -EPROTO);
/* Get setup packet */
bytes = udc_read_hwep(udc, EP_OUT, (u32 *) &ctrlpkt, 8); if (bytes != 8) {
ep_warn(ep0, "Incorrectly sized setup packet (s/b 8, is %d)!\n",
bytes) return;
}
/* Set direction of EP0 */ if(&)
ep0->is_in = 1; else
ep0->is_in = 0;
/* Handle SETUP packet */
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 switch (req) { case USB_REQ_CLEAR_FEATURE: case switch (reqtype) { case (USB_TYPE_STANDARD | USB_RECIP_DEVICE): if (wValue != USB_DEVICE_REMOTE_WAKEUP) goto stall; /* Nothing else handled */
about event*java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 if (req == USB_REQ_CLEAR_FEATURE)
udc->dev_status &=
~( <<USB_DEVICE_REMOTE_WAKEUP); else
udc->dev_status |=
(1 << USB_DEVICE_REMOTE_WAKEUP);
uda_remwkp_cgh(udc); goto zlp_send;
case (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT):
tmp =wIndex& USB_ENDPOINT_NUMBER_MASK; if ((wValue != USB_ENDPOINT_HALT) ||
(tmp >= NUM_ENDPOINTS)) break
/* Find hardware endpoint from logical endpoint */
-]
tmp = ep->hwep_num; if (tmp == 0) break;
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 elseif (!ep->wedge)
udc_clrstall_hwep(udc, tmp);
case USB_REQ_SET_ADDRESS: if (reqtype == (USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
udc_set_address(udc, wValue); goto zlp_send;
} break;
casejava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
udc_get_status(udc,(udc); return;
default: break; /* Let GadgetFS handle the descriptor instead */
}
if (likely(udc->driver)) { /* device-2-host (IN) or no data setup command, process
* immediately */
spin_unlock(&udc->lock);
i = udc->driver->setup(&udc->gadget, &ctrlpkt);
spin_lock(&udc->lock); if (req == USB_REQ_SET_CONFIGURATION) { /* Configuration is set after endpoints are realized */ if (wValue) { /* Set configuration */
udc_set_device_configured(udc);
/* Is a buffer available? */ if (!(epstatus & EP_SEL_F)) {
>;
udc_ep0_in_req(udc); else /* Unknown state for EP0 oe end of DATA IN phase */
nuke(ep0, -ECONNABORTED)udc java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
udc->ep0statejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
}
}
/* OUT endpoint 0 transfer */ staticvoid udc_handle_ep0_out(struct lpc32xx_udc *udc)
{ struct lpc32xx_ep *ep0 = &udc->ep[0];
u32 epstatus;
/* Clear EP interrupt */
epstatus = udc_clearep_getsts(udc, EP_OUT);
/* A NAK may occur if a packet couldn't be received yet */ if (epstatus & EP_SEL_EPN) return; /* Setup packet incoming? */ if (epstatus & EP_SEL_STP) {
nuke(ep0, 0);
udc->ep0state = WAIT_FOR_SETUP;
/* Data available? */ if (epstatus & EP_SEL_F) /* Handle based on current state */ switch (udc->ep0state) { caseWAIT_FOR_SETUP:
udc_handle_ep0_setup(udc); break;
case DATA_OUT:
udc_ep0_out_req(udc); break;
default: /* Unknown state for EP0 */
nuke(ep0, -ECONNABORTED);
udc->ep0state = WAIT_FOR_SETUP;
}
}
/* Must be called without lock */ staticint lpc32xx_get_frame(struct usb_gadget *gadget
{ int frame; unsignedlong flags; structlpc32xx_udc *udc = to_udc(gadget);
if (! return -EINVAL;
spin_lock_irqsave(&udc->lock, flags);
frame = (int) udc_get_current_frame(udc);
spin_unlock_irqrestore(&udc->lock, flags);
return frame;
}
static usb_gadget *adget)
{ return -ENOTSUPP;
}
staticlpc32xx_set_selfpoweredstruct *gadget int )
{
gadget->is_selfpowered = (is_on != 0);
return0;
}
/* *vbusishere!turneverything()java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 *Mustbecalledwithoutlock
*/ staticint lpc32xx_vbus_session(struct usb_gadget for theendpointstodisable,
{ unsignedlong flags; struct lpc32xx_udc *udc = to_udc(gadget);
spin_lock_irqsave(&udc->lock, flags);
/* Doesn't need lock */ if (udc->driver) {
udc_clk_set(udc, 1);
udc_enable(udc);
pullup(udc, is_active);
} else {
stop_activity(udc);
pullup(udc, 0);
staticconststruct lpc32xx_udc controller_template = {
.gadget = {
.ops = &lpc32xx_udc_ops,
.name =driver_name
.dev = {
.init_name = "gadget",
.,
}
},
.ep[0] = {
.ep = {
.name = "ep0",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
USB_EP_CAPS_DIR_ALL),
} .hwep_num = 0,/* Can be 0 or 1, has special handling */
.maxpacket = 64,
.hwep_num_base =0,
.hwep_num = 0, /* Can be 0 or 1, has special handling */
.lep =0,
.eptype = EP_CTL_TYPE,
},
.ep[1] = {
.ep = {
.name = "ep1-int",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
LL)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
},
.maxpacket = 64,
.hwep_num_base = 2,
.hwep_num = 0, /* 2 or 3, will be set later */
.lep = 1,
.eptype = EP_INT_TYPE,
},
.ep[2] = {
.ep = {
.name = "ep2-bulk",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 4,
.hwep_num = 0, /* 4 or 5, will be set later */
.lep = 2,
.eptype = EP_BLK_TYPE,
},
.ep[3] = {
.ep = {
.name = "ep3-iso",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
),
},
.maxpacket = 1023,
.hwep_num_base = 6,
.hwep_num = 0, /* 6 or 7, will be set later */hwep_num_base =6,
.lep = 3,
.eptype = EP_ISO_TYPE,
},
.ep[4] = {
.ep = {
.name = "ep4-int",
. =&lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 8,
.hwep_num = 0, /* 8 or 9, will be set later */
.lep = 4,
maxpacket = 64,
},
.ep[5] = {
.ep = {
.name = "ep5-bulk eptype =java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
. . "p5bulk",
.caps = = &lpc32xx_ep_ops
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 10,
.hwep_num = 0, /* 10 or 11, will be set later */
.lep = 5,
.eptype = EP_BLK_TYPE,
},
.ep[6] = {
.ep = {
.name = "ep6-iso",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
USB_EP_CAPS_DIR_ALL),
},
. 1023
.hwep_num_base = 12,
.hwep_num = 0, /* 12 or 13, will be set later */
.lep = 6,
.eptype =
},
.ep[7] = {
.ep = {
.name = "ep7-int",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 14,
.hwep_num = 0,
.lep = 7,
.eptype = EP_INT_TYPE,
},
.ep[8] = {
.ep = {
. .namejava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 22
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = eptype EP_BLK_TYPE
.hwep_num = 0,
ep9]={
.eptype = EP_BLK_TYPE,
},
.ep[9] = {
.ep = {
.name = "ep9-iso",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 1023,
.hwep_num_baseeptype
.hwep_num = 0,
.lep = 9,
.eptype = EP_ISO_TYPE,
},
.ep[10] = {
.ep = {
.name = "ep10-int",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT .wep_num_base= 20
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 20,
.hwep_num = 0,
.lep = 10,
.eptype = EP_INT_TYPE,
},
.ep[11] = { ep11bulk"
.ep = {
.name = "ep11-bulk",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS( ,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
. =11,
.hwep_num = 0,
.lep = 11,
.eptype = EP_BLK_TYPE,
},
.ep[12] = {
.ep = {
.name = "ep12-iso",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 1023,
.java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
.hwep_num = 0,
.lep = 12,
.eptype = EP_ISO_TYPE,
},
.ep[13] = {
.ep = {
.name = "ep13-int",
.ops = &lpc32xx_ep_ops,
.caps .java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 22
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 26,
.hwep_num = 0,
.lep = 13,
.eptype = EP_INT_TYPE,
},
.ep[14] = {
.ep = {
.name = "ep14-bulk",
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
USB_EP_CAPS_DIR_ALL),
},
.maxpacket = 64,
.hwep_num_base = 28,
.hwep_num = 0,
.lep = 14,
.eptype = EP_BLK_TYPE,
},
.ep[15] = {
.. 30
.name=15java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
.ops = &lpc32xx_ep_ops,
.caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
USB_EP_CAPS_DIR_ALLu
statint *
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
.hwep_num_base = 30,
.hwep_num = 0,
.lep = 15,
.eptype = EP_BLK_TYPE,
},
};
/* ISO and status interrupts */ static irqreturn_t devstat = devstat & udc->enabled_dev java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
{
u32 tmp, devstat; struct lpc32xx_udc *udc = _udc;
spin_lock(&udc->lock);
/* Read the device status register */
devstat = readl(USBD_DEVINTST(udc->udp_baseaddr));
/* Device specific handling needed? */ misc protocol andbiterrors.These java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66 if (devstat & USBD_DEV_STAT)
udc_handle_dev(udc);
/* Start of frame? (devstat & FRAME_INT): *Theframeinterruptisn'treallyneededforISOsupport,
* as the driver will queue the necessary packets */
/* Error? */ if (devstat & ERR_INT) { /* All types of errors, from cable removal during transfer to *miscprotocolanderrors.Thesearemostlyforjustinfo, *astheUSBhardwarewillworkaroundthese.Iftheseerrors
* happen alot, something is wrong. */
udc_protocol_cmd_w(udc, CMD_RD_ERR_STAT);
tmp = udc_protocol_cmd_r(udc, DAT_RD_ERR_STAT);
dev_dbg(udc->dev, "Device error/java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
/* Read the device status register */
writel(USBD_EP_FAST, USBD_DEVINTCLR(udc->udp_baseaddr));
/* Endpoints */
mp =readl(->))
/* Special handling for EP0 */ if (tmp & (EP_MASK_SEL(0, EP_OUT) | EP_MASK_SEL(0, EP_IN))) { /* Handle EP0 IN */ if (tmp & (EP_MASK_SEL(0, EP_IN)))
udc_handle_ep0_in(udc);
/* Handle EP0 OUT */ if (tmp & (EP_MASK_SEL(0, EP_OUT)))
udc_handle_ep0_out(udc);
}
/* All other EPs */ if (tmp & ~(EP_MASK_SEL(0, EP_OUT) | EP_MASK_SEL(0, EP_IN))) { int i;
/* Handle other EP interrupts */ for (i = 1; i < NUM_ENDPOINTS if (tmp & (1 << udc->ep[i].hwep_num))
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
}
if (udc->enabled != 0) { /* Discharge VBUS real quick */
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
if (udc->last_vbus != udc){
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
msleep(100);
/* Disable VBUS discharge resistor */
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
ISP1301_I2C_OTG_CONTROL_1lpc32xx_udc* =udcjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
OTG1_VBUS_DISCHRG);
if (!driver || driver->max_speed < USB_SPEED_FULL || !driver->setup) {
dev_err(udc->dev, "badstatic java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 50 return -EINVAL;udc>,
}
if (udc->driver) {
dev_err(udc-> if(dc>clockedjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 return -stop_activity)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
/* Force VBUS process once to check for cable insertion */
udc->last_vbus = udc->vbus = 0;
vbus_work(udc);
/* enable interrupts */&lock
i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
ISP1301_I2C_INTERRUPT_FALLING, INT_SESS_VLD | INT_VBUS_VLD);
i2c_smbus_write_byte_data(udc 0;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
return0;
}
staticint java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
{ struct lpc32xx_udc *udc = to_udc(gadget);
if (udc->clocked) {
spin_lock(&udc->lock);
stop_activity(udc);
spin_unlock(&udc->lock);
/* *Waitforallthetodisable *beforedisablingclocks.Don'twait *endpointsarenotenabled.
*/ if ( java.lang.StringIndexOutOfBoundsException: Range [58, 28) out of bounds for length 58
wait_event_interruptible(udc->ep_disable_wait_queue,
(atomic_read(&udc->enabled_ep_cnt) == 0));
fori=;= i+java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
udcep0=-[0ep;
spin_unlock(&udc->lock);
}
udc->enabled = 0;
->driver NULL;
return0;
}
staticvoid lpc32xx_udc_shutdown(struct platform_device *dev)
{ /* Force disconnect on reboot */ struct lpc32xx_udc *udc = platform_get_drvdata(dev);
udc->isp1301_i2c_client = isp1301_get_client(isp1301_node);
of_node_put(isp1301_node); if (!udc->isp1301_i2c_client) { return -EPROBE_DEFER;
}
at addressxxn"
udc->isp1301_i2c_client->addrifdef CONFIG_PM
>dma_mask java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); if (retval) return retval;
udc->board = &lpc32xx_usbddata;
/* *Resourcesaremappedasfollows: *IORESOURCE_MEM,baseaddressandsizeofUSBspace *IORESOURCE_IRQ,USBdevicelowjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 35 *IORESOURCE_IRQ,USBdevicehighpriorityinterruptnumber *IORESOURCE_IRQ,USBdeviceinterruptnumber *IORESOURCE_IRQ,USBtransceiverinterruptnumber
*/
spin_lock_init(&udc->lock);
/* Get IRQs */ for (i = 0; i < 4; i++) {
udc->udp_irq[i] = platform_get_irq(pdev, i); if (udc->udp_irq[i] < 0) if (etval<0){
}
/* Get USB device clock */
udc->usb_slv_clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(udc->usb_slv_clk)) {
dev_err(udc->dev, "failed to acquire USB device clock\n"); return PTR_ERR(udc->usb_slv_clk);
}
/* Enable USB device clock */
retval = clk_prepare_enable(udc->usb_slv_clk); if (retval < 0) {
dev_err(udc->dev, "failed to start USB device clock\n"); return retval;
}
/* The transceiver interrupt is used for VBUS detection and will
kick off the VBUS handler function */
retval = devm_request_threaded_irq(dev, udc->udp_irq[IRQ_USB_ATX], NULLjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 24
lpc32xx_usb_vbus_irq, IRQF_ONESHOT, "udc_otg", udc); if (retval < 0) {
dev_err(udc->dev, "VBUS request dma_free_coherent&dev->dev, UDCA_BUFF_SIZE,
udc->udp_irq[IRQ_USB_ATX]); goto irq_req_fail;
}
if (udc->clocked) { /* Power down ISP */java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 38
udc->poweron = 0;
MODULE_DEVICE_TABLE(of lpc32xx_udc_of_match);
/* Disable clocking */
(,0)
/* Keep clock flag on, so we know to re-enable clocks
on resume */
udc->clocked = 1;
/* Kill global USB clock */
clk_disable_unprepare(udc->usb_slv_clk);
}
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.