#include "musbdefs.h"
-/* ep0 is always musb->aLocalEnd[0].ep_in */
-#define next_ep0_request(musb) next_in_request(&(musb)->aLocalEnd[0])
+/* ep0 is always musb->endpoints[0].ep_in */
+#define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0])
/*
* Locking note: we use only the controller lock, for simpler correctness.
is_in = bEnd & USB_DIR_IN;
if (is_in) {
bEnd &= 0x0f;
- ep = &musb->aLocalEnd[bEnd].ep_in;
+ ep = &musb->endpoints[bEnd].ep_in;
} else {
- ep = &musb->aLocalEnd[bEnd].ep_out;
+ ep = &musb->endpoints[bEnd].ep_out;
}
- regs = musb->aLocalEnd[bEnd].regs;
+ regs = musb->endpoints[bEnd].regs;
if (bEnd >= MUSB_C_NUM_EPS || !ep->desc) {
handled = -EINVAL;
if (len > 2)
len = 2;
- musb_write_fifo(&musb->aLocalEnd[0], len, bResult);
+ musb_write_fifo(&musb->endpoints[0], len, bResult);
}
return handled;
static void musb_g_ep0_giveback(struct musb *musb, struct usb_request *req)
{
musb->ep0_state = MGC_END0_STAGE_SETUP;
- musb_g_giveback(&musb->aLocalEnd[0].ep_in, req, 0);
+ musb_g_giveback(&musb->endpoints[0].ep_in, req, 0);
}
/*
break;
if (pControlRequest->wIndex & USB_DIR_IN)
- musb_ep = &musb->aLocalEnd[bEnd].ep_in;
+ musb_ep = &musb->endpoints[bEnd].ep_in;
else
- musb_ep = &musb->aLocalEnd[bEnd].ep_out;
+ musb_ep = &musb->endpoints[bEnd].ep_out;
if (!musb_ep->desc)
break;
!= USB_ENDPOINT_HALT)
break;
- ep = musb->aLocalEnd + bEnd;
+ ep = musb->endpoints + bEnd;
regs = ep->regs;
is_in = pControlRequest->wIndex & USB_DIR_IN;
if (is_in)
req->status = -EOVERFLOW;
tmp = len;
}
- musb_read_fifo(&this->aLocalEnd[0], tmp, buf);
+ musb_read_fifo(&this->endpoints[0], tmp, buf);
req->actual += tmp;
tmp = MGC_M_CSR0_P_SVDRXPKTRDY;
if (tmp < 64 || req->actual == req->length) {
pFifoSource = (u8 *) pRequest->buf + pRequest->actual;
fifo_count = min((unsigned) MGC_END0_FIFOSIZE,
pRequest->length - pRequest->actual);
- musb_write_fifo(&musb->aLocalEnd[0], fifo_count, pFifoSource);
+ musb_write_fifo(&musb->endpoints[0], fifo_count, pFifoSource);
pRequest->actual += fifo_count;
/* update the flags */
struct usb_request *r;
void __iomem *regs = musb->control_ep->regs;
- musb_read_fifo(&musb->aLocalEnd[0], sizeof *req, (u8 *)req);
+ musb_read_fifo(&musb->endpoints[0], sizeof *req, (u8 *)req);
/* NOTE: earlier 2.6 versions changed setup packets to host
* order, but now USB packets always stay in USB byte order.
u16 wCsrVal;
u16 len;
void __iomem *mbase = musb->mregs;
- void __iomem *regs = musb->aLocalEnd[0].regs;
+ void __iomem *regs = musb->endpoints[0].regs;
irqreturn_t retval = IRQ_NONE;
MGC_SelectEnd(mbase, 0); /* select ep0 */
static void nuke(struct musb_ep *ep, const int status)
{
struct musb_request *req = NULL;
- void __iomem *epio = ep->musb->aLocalEnd[ep->bEndNumber].regs;
+ void __iomem *epio = ep->musb->endpoints[ep->bEndNumber].regs;
ep->busy = 1;
{
u8 bEnd = req->bEnd;
struct musb_ep *musb_ep;
- void __iomem *epio = musb->aLocalEnd[bEnd].regs;
+ void __iomem *epio = musb->endpoints[bEnd].regs;
struct usb_request *pRequest;
u16 fifo_count = 0, wCsrVal;
int use_dma = 0;
u16 wCsrVal;
struct usb_request *pRequest;
u8 __iomem *mbase = musb->mregs;
- struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_in;
- void __iomem *epio = musb->aLocalEnd[bEnd].regs;
+ struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_in;
+ void __iomem *epio = musb->endpoints[bEnd].regs;
struct dma_channel *dma;
MGC_SelectEnd(mbase, bEnd);
u16 wCsrVal = 0;
const u8 bEnd = req->bEnd;
struct usb_request *pRequest = &req->request;
- struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out;
- void __iomem *epio = musb->aLocalEnd[bEnd].regs;
+ struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out;
+ void __iomem *epio = musb->endpoints[bEnd].regs;
u16 fifo_count = 0;
u16 len = musb_ep->wPacketSize;
u16 wCsrVal;
struct usb_request *pRequest;
void __iomem *mbase = musb->mregs;
- struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out;
- void __iomem *epio = musb->aLocalEnd[bEnd].regs;
+ struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out;
+ void __iomem *epio = musb->endpoints[bEnd].regs;
struct dma_channel *dma;
MGC_SelectEnd(mbase, bEnd);
musb_ep = to_musb_ep(ep);
musb = musb_ep->musb;
bEnd = musb_ep->bEndNumber;
- epio = musb->aLocalEnd[bEnd].regs;
+ epio = musb->endpoints[bEnd].regs;
spin_lock_irqsave(&musb->Lock, flags);
MGC_SelectEnd(musb->mregs, bEnd);
struct musb_ep *musb_ep = to_musb_ep(ep);
u8 bEnd = musb_ep->bEndNumber;
struct musb *musb = musb_ep->musb;
- void __iomem *epio = musb->aLocalEnd[bEnd].regs;
+ void __iomem *epio = musb->endpoints[bEnd].regs;
void __iomem *mbase;
unsigned long flags;
u16 wCsr;
struct musb_ep *musb_ep = to_musb_ep(ep);
struct musb *musb = musb_ep->musb;
u8 nEnd = musb_ep->bEndNumber;
- void __iomem *epio = musb->aLocalEnd[nEnd].regs;
+ void __iomem *epio = musb->endpoints[nEnd].regs;
void __iomem *mbase;
unsigned long flags;
u16 wCsr, wIntrTxE;
static void __init
init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in)
{
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints + bEnd;
memset(ep, 0, sizeof *ep);
/* intialize endpoint list just once */
INIT_LIST_HEAD(&(musb->g.ep_list));
- for (bEnd = 0, hw_ep = musb->aLocalEnd;
+ for (bEnd = 0, hw_ep = musb->endpoints;
bEnd < musb->bEndCount;
bEnd++, hw_ep++) {
if (hw_ep->bIsSharedFifo /* || !bEnd */) {
* then report disconnect
*/
if (driver) {
- for (i = 0, hw_ep = musb->aLocalEnd;
+ for (i = 0, hw_ep = musb->endpoints;
i < musb->bEndCount;
i++, hw_ep++) {
MGC_SelectEnd(musb->mregs, i);
u8 bDone = FALSE;
u32 length;
int do_flush = 0;
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints + bEnd;
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh = hw_ep->in_qh;
int nPipe = pUrb->pipe;
struct dma_channel *pDmaChannel;
u8 bDmaOk;
void __iomem *mbase = musb->mregs;
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints + bEnd;
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh;
u16 wPacketSize;
size_t wLength = 0;
u8 *pBuffer = NULL;
struct urb *pUrb;
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints + bEnd;
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh = hw_ep->out_qh;
u32 status = 0;
void musb_host_rx(struct musb *musb, u8 bEnd)
{
struct urb *pUrb;
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints + bEnd;
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh = hw_ep->in_qh;
size_t xfer_len;
if (musb->periodic[nEnd])
continue;
- hw_ep = &musb->aLocalEnd[nEnd];
+ hw_ep = &musb->endpoints[nEnd];
if (hw_ep == musb->bulk_ep)
continue;
return -ENOSPC;
idle = 1;
- hw_ep = musb->aLocalEnd + nBestEnd;
+ hw_ep = musb->endpoints + nBestEnd;
musb->periodic[nBestEnd] = qh;
DBG(4, "qh %p periodic slot %d\n", qh, nBestEnd);
success:
{
int code = 0;
char *buf = aBuffer;
- struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd];
+ struct musb_hw_ep *hw_ep = &musb->endpoints[bEnd];
do {
MGC_SelectEnd(musb->mregs, bEnd);
void __iomem *conf;
#endif
- /* index in musb->aLocalEnd[] */
+ /* index in musb->endpoints[] */
u8 epnum;
/* hardware configuration, possibly dynamic */
int nIrq;
- struct musb_hw_ep aLocalEnd[MUSB_C_NUM_EPS];
-#define control_ep aLocalEnd
+ struct musb_hw_ep endpoints[MUSB_C_NUM_EPS];
+#define control_ep endpoints
#define VBUSERR_RETRY_COUNT 3
u16 vbuserr_retry;
void musb_load_testpacket(struct musb *musb)
{
- void __iomem *regs = musb->aLocalEnd[0].regs;
+ void __iomem *regs = musb->endpoints[0].regs;
MGC_SelectEnd(musb->mregs, 0);
musb_write_fifo(musb->control_ep,
/* start any periodic Tx transfers waiting for current frame */
wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME);
- ep = musb->aLocalEnd;
+ ep = musb->endpoints;
for (bEnd = 1; (bEnd < musb->bEndCount)
&& (musb->wEndMask >= (1 << bEnd));
bEnd++, ep++) {
const struct fifo_cfg *cfg;
unsigned i, n;
int offset;
- struct musb_hw_ep *hw_ep = musb->aLocalEnd;
+ struct musb_hw_ep *hw_ep = musb->endpoints;
switch (fifo_mode) {
default:
for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) {
MGC_SelectEnd(mbase, bEnd);
- hw_ep = musb->aLocalEnd + bEnd;
+ hw_ep = musb->endpoints + bEnd;
/* read from core using indexed model */
reg = musb_readb(hw_ep->regs, 0x10 + MGC_O_HDRC_FIFOSIZE);
musb_driver_name, type, aRevision, aDate);
/* configure ep0 */
- musb->aLocalEnd[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE;
- musb->aLocalEnd[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE;
+ musb->endpoints[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE;
+ musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE;
/* discover endpoint configuration */
musb->bEndCount = 1;
/* finish init, and print endpoint config */
for (i = 0; i < musb->bEndCount; i++) {
- struct musb_hw_ep *hw_ep = musb->aLocalEnd + i;
+ struct musb_hw_ep *hw_ep = musb->endpoints + i;
hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
#ifdef CONFIG_USB_TUSB6010
musb->mregs = mbase;
musb->ctrl_base = mbase;
musb->nIrq = -ENODEV;
- for (epnum = 0, ep = musb->aLocalEnd;
+ for (epnum = 0, ep = musb->endpoints;
epnum < MUSB_C_NUM_EPS;
epnum++, ep++) {