From: Tony Lindgren <tony@atomide.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz
Date: Mon, 13 Aug 2007 06:49:26 -0700 [thread overview]
Message-ID: <11870131044061-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <11870131023809-git-send-email-tony@atomide.com>
Search and replace wPacketSize with packet_sz
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/usb/musb/musb_gadget.c | 38 +++++++++++++++++++-------------------
drivers/usb/musb/musb_gadget.h | 2 +-
drivers/usb/musb/musb_host.c | 20 ++++++++++----------
drivers/usb/musb/musbhsdma.c | 24 ++++++++++++------------
4 files changed, 42 insertions(+), 42 deletions(-)
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -205,7 +205,7 @@ static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep)
if (can_bulk_split(musb, ep->type))
return ep->hw_ep->max_packet_sz_tx;
else
- return ep->wPacketSize;
+ return ep->packet_sz;
}
@@ -287,7 +287,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
}
DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n",
- epnum, musb_ep->wPacketSize, fifo_count,
+ epnum, musb_ep->packet_sz, fifo_count,
csr);
#ifndef CONFIG_USB_INVENTRA_FIFO
@@ -305,13 +305,13 @@ static void txstate(struct musb *musb, struct musb_request *req)
/* setup DMA, then program endpoint CSR */
request_size = min(request->length,
musb_ep->dma->max_len);
- if (request_size <= musb_ep->wPacketSize)
+ if (request_size <= musb_ep->packet_sz)
musb_ep->dma->desired_mode = 0;
else
musb_ep->dma->desired_mode = 1;
use_dma = use_dma && c->channel_program(
- musb_ep->dma, musb_ep->wPacketSize,
+ musb_ep->dma, musb_ep->packet_sz,
musb_ep->dma->desired_mode,
request->dma, request_size);
if (use_dma) {
@@ -359,7 +359,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
* except for the last-packet-is-already-short case.
*/
use_dma = use_dma && c->channel_program(
- musb_ep->dma, musb_ep->wPacketSize,
+ musb_ep->dma, musb_ep->packet_sz,
0,
request->dma,
request->length);
@@ -372,7 +372,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
}
#elif defined(CONFIG_USB_TUSB_OMAP_DMA)
use_dma = use_dma && c->channel_program(
- musb_ep->dma, musb_ep->wPacketSize,
+ musb_ep->dma, musb_ep->packet_sz,
request->zero,
request->dma,
request->length);
@@ -483,13 +483,13 @@ void musb_g_tx(struct musb *musb, u8 epnum)
if ((request->zero
&& request->length
&& (request->length
- % musb_ep->wPacketSize)
+ % musb_ep->packet_sz)
== 0)
#ifdef CONFIG_USB_INVENTRA_DMA
|| (is_dma &&
((!dma->desired_mode) ||
(request->actual &
- (musb_ep->wPacketSize - 1))))
+ (musb_ep->packet_sz - 1))))
#endif
) {
/* on dma completion, fifo may not
@@ -578,7 +578,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
void __iomem *epio = musb->endpoints[epnum].regs;
u16 fifo_count = 0;
- u16 len = musb_ep->wPacketSize;
+ u16 len = musb_ep->packet_sz;
csr = musb_readw(epio, MGC_O_HDRC_RXCSR);
@@ -592,7 +592,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
* faults will be handled correctly.
*/
if (c->channel_program(channel,
- musb_ep->wPacketSize,
+ musb_ep->packet_sz,
!request->short_not_ok,
request->dma + request->actual,
request->length - request->actual)) {
@@ -665,14 +665,14 @@ static void rxstate(struct musb *musb, struct musb_request *req)
#else
transfer_size = len;
#endif
- if (transfer_size <= musb_ep->wPacketSize)
+ if (transfer_size <= musb_ep->packet_sz)
musb_ep->dma->desired_mode = 0;
else
musb_ep->dma->desired_mode = 1;
use_dma = c->channel_program(
channel,
- musb_ep->wPacketSize,
+ musb_ep->packet_sz,
channel->desired_mode,
request->dma
+ request->actual,
@@ -688,7 +688,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n",
musb_ep->end_point.name,
len, fifo_count,
- musb_ep->wPacketSize);
+ musb_ep->packet_sz);
fifo_count = min(len, fifo_count);
@@ -700,7 +700,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
int ret;
ret = c->channel_program(channel,
- musb_ep->wPacketSize,
+ musb_ep->packet_sz,
channel->desired_mode,
dma_addr,
fifo_count);
@@ -725,7 +725,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
}
/* reach the end or short packet detected */
- if (request->actual == request->length || len < musb_ep->wPacketSize)
+ if (request->actual == request->length || len < musb_ep->packet_sz)
musb_g_giveback(musb_ep, request, 0);
}
@@ -807,7 +807,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
/* Autoclear doesn't clear RxPktRdy for short packets */
if ((dma->desired_mode == 0)
|| (dma->actual_len
- & (musb_ep->wPacketSize - 1))) {
+ & (musb_ep->packet_sz - 1))) {
/* ack the read! */
csr &= ~MGC_M_RXCSR_RXPKTRDY;
musb_writew(epio, MGC_O_HDRC_RXCSR, csr);
@@ -816,7 +816,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
/* incomplete, and not short? wait for next IN packet */
if ((request->actual < request->length)
&& (musb_ep->dma->actual_len
- == musb_ep->wPacketSize))
+ == musb_ep->packet_sz))
goto done;
#endif
musb_g_giveback(musb_ep, request, 0);
@@ -887,7 +887,7 @@ static int musb_gadget_enable(struct usb_ep *ep,
tmp = le16_to_cpu(desc->wMaxPacketSize);
if (tmp & ~0x07ff)
goto fail;
- musb_ep->wPacketSize = tmp;
+ musb_ep->packet_sz = tmp;
/* enable the interrupts for the endpoint, set the endpoint
* packet size (or fail), set the mode, clear the fifo
@@ -983,7 +983,7 @@ static int musb_gadget_enable(struct usb_ep *ep,
}; s; }),
musb_ep->is_in ? "IN" : "OUT",
musb_ep->dma ? "dma, " : "",
- musb_ep->wPacketSize);
+ musb_ep->packet_sz);
schedule_work(&musb->irq_work);
--- a/drivers/usb/musb/musb_gadget.h
+++ b/drivers/usb/musb/musb_gadget.h
@@ -67,7 +67,7 @@ struct musb_ep {
/* ... when enabled/disabled ... */
u8 type;
u8 is_in;
- u16 wPacketSize;
+ u16 packet_sz;
const struct usb_endpoint_descriptor *desc;
struct dma_channel *dma;
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -634,14 +634,14 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
void __iomem *epio = hw_ep->regs;
struct musb_qh *qh;
- u16 wPacketSize;
+ u16 packet_sz;
if (!is_out || hw_ep->is_shared_fifo)
qh = hw_ep->in_qh;
else
qh = hw_ep->out_qh;
- wPacketSize = qh->maxpacket;
+ packet_sz = qh->maxpacket;
DBG(3, "%s hw%d urb %p spd%d dev%d ep%d%s "
"h_addr%02x h_port%02x bytes %d\n",
@@ -739,12 +739,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_writeb(epio, MGC_O_HDRC_TXTYPE, qh->type_reg);
if (can_bulk_split(musb, qh->type))
musb_writew(epio, MGC_O_HDRC_TXMAXP,
- wPacketSize
+ packet_sz
| ((hw_ep->max_packet_sz_tx /
- wPacketSize) - 1) << 11);
+ packet_sz) - 1) << 11);
else
musb_writew(epio, MGC_O_HDRC_TXMAXP,
- wPacketSize);
+ packet_sz);
musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, qh->intv_reg);
} else {
musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, qh->intv_reg);
@@ -757,7 +757,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
wLoadCount = min((u32) hw_ep->max_packet_sz_tx,
dwLength);
else
- wLoadCount = min((u32) wPacketSize, dwLength);
+ wLoadCount = min((u32) packet_sz, dwLength);
#ifdef CONFIG_USB_INVENTRA_DMA
if (pDmaChannel) {
@@ -773,7 +773,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
qh->segsize = min(dwLength, pDmaChannel->max_len);
- if (qh->segsize <= wPacketSize)
+ if (qh->segsize <= packet_sz)
pDmaChannel->desired_mode = 0;
else
pDmaChannel->desired_mode = 1;
@@ -792,7 +792,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr);
bDmaOk = dma_controller->channel_program(
- pDmaChannel, wPacketSize,
+ pDmaChannel, packet_sz,
pDmaChannel->desired_mode,
pUrb->transfer_dma,
qh->segsize);
@@ -831,7 +831,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
* to identify the zero-length-final-packet case.
*/
bDmaOk = dma_controller->channel_program(
- pDmaChannel, wPacketSize,
+ pDmaChannel, packet_sz,
(pUrb->transfer_flags
& URB_ZERO_PACKET)
== URB_ZERO_PACKET,
@@ -916,7 +916,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
* errors, we dare not queue multiple transfers.
*/
bDmaOk = dma_controller->channel_program(
- pDmaChannel, wPacketSize,
+ pDmaChannel, packet_sz,
!(pUrb->transfer_flags
& URB_SHORT_NOT_OK),
pUrb->transfer_dma,
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -171,7 +171,7 @@ static void dma_channel_release(struct dma_channel *pChannel)
}
static void configure_channel(struct dma_channel *pChannel,
- u16 wPacketSize, u8 mode,
+ u16 packet_sz, u8 mode,
dma_addr_t dma_addr, u32 dwLength)
{
struct musb_dma_channel *pImplChannel =
@@ -182,20 +182,20 @@ static void configure_channel(struct dma_channel *pChannel,
u16 wCsr = 0;
DBG(4, "%p, pkt_sz %d, addr 0x%x, len %d, mode %d\n",
- pChannel, wPacketSize, dma_addr, dwLength, mode);
+ pChannel, packet_sz, dma_addr, dwLength, mode);
if (mode) {
wCsr |= 1 << MGC_S_HSDMA_MODE1;
- if (dwLength < wPacketSize) {
+ if (dwLength < packet_sz) {
return FALSE;
}
- if (wPacketSize >= 64) {
+ if (packet_sz >= 64) {
wCsr |=
MGC_HSDMA_BURSTMODE_INCR16 << MGC_S_HSDMA_BURSTMODE;
- } else if (wPacketSize >= 32) {
+ } else if (packet_sz >= 32) {
wCsr |=
MGC_HSDMA_BURSTMODE_INCR8 << MGC_S_HSDMA_BURSTMODE;
- } else if (wPacketSize >= 16) {
+ } else if (packet_sz >= 16) {
wCsr |=
MGC_HSDMA_BURSTMODE_INCR4 << MGC_S_HSDMA_BURSTMODE;
}
@@ -221,7 +221,7 @@ static void configure_channel(struct dma_channel *pChannel,
}
static int dma_channel_program(struct dma_channel * pChannel,
- u16 wPacketSize, u8 mode,
+ u16 packet_sz, u8 mode,
dma_addr_t dma_addr, u32 dwLength)
{
struct musb_dma_channel *pImplChannel =
@@ -230,7 +230,7 @@ static int dma_channel_program(struct dma_channel * pChannel,
DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n",
pImplChannel->epnum,
pImplChannel->bTransmit ? "Tx" : "Rx",
- wPacketSize, dma_addr, dwLength, mode);
+ packet_sz, dma_addr, dwLength, mode);
BUG_ON(pChannel->status == MGC_DMA_STATUS_UNKNOWN ||
pChannel->status == MGC_DMA_STATUS_BUSY);
@@ -238,14 +238,14 @@ static int dma_channel_program(struct dma_channel * pChannel,
pChannel->actual_len = 0;
pImplChannel->dwStartAddress = dma_addr;
pImplChannel->len = dwLength;
- pImplChannel->wMaxPacketSize = wPacketSize;
+ pImplChannel->wMaxPacketSize = packet_sz;
pChannel->status = MGC_DMA_STATUS_BUSY;
- if ((mode == 1) && (dwLength >= wPacketSize)) {
- configure_channel(pChannel, wPacketSize, 1, dma_addr,
+ if ((mode == 1) && (dwLength >= packet_sz)) {
+ configure_channel(pChannel, packet_sz, 1, dma_addr,
dwLength);
} else
- configure_channel(pChannel, wPacketSize, 0, dma_addr,
+ configure_channel(pChannel, packet_sz, 0, dma_addr,
dwLength);
return TRUE;
--
1.5.2.3
next prev parent reply other threads:[~2007-08-13 13:49 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 13:48 (no subject) Tony Lindgren
2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren
2007-08-13 13:48 ` [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep Tony Lindgren
2007-08-13 13:48 ` [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep Tony Lindgren
2007-08-13 13:48 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren
2007-08-13 13:48 ` [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs Tony Lindgren
2007-08-13 13:48 ` [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase Tony Lindgren
2007-08-13 13:48 ` [PATCH 7/52] musb_hdrc: Search and replace pSource with src Tony Lindgren
2007-08-13 13:48 ` [PATCH 8/52] musb_hdrc: Search and replace pDest with dst Tony Lindgren
2007-08-13 13:48 ` [PATCH 9/52] musb_hdrc: Search and replace dwCount with len Tony Lindgren
2007-08-13 13:48 ` [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count Tony Lindgren
2007-08-13 13:48 ` [PATCH 11/52] musb_hdrc: Search and replace wCount with len Tony Lindgren
2007-08-13 13:48 ` [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum Tony Lindgren
2007-08-13 13:48 ` [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints Tony Lindgren
2007-08-13 13:48 ` [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints Tony Lindgren
2007-08-13 13:48 ` [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum Tony Lindgren
2007-08-13 13:48 ` [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage Tony Lindgren
2007-08-13 13:48 ` [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum Tony Lindgren
2007-08-13 13:48 ` [PATCH 18/52] musb_hdrc: Search and replace Lock with lock Tony Lindgren
2007-08-13 13:48 ` [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select Tony Lindgren
2007-08-13 13:48 ` [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb Tony Lindgren
2007-08-13 13:48 ` [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host Tony Lindgren
2007-08-13 13:48 ` [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor Tony Lindgren
2007-08-13 13:48 ` [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo Tony Lindgren
2007-08-13 13:48 ` [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx Tony Lindgren
2007-08-13 13:49 ` [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx Tony Lindgren
2007-08-13 13:49 ` [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller Tony Lindgren
2007-08-13 13:49 ` [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint Tony Lindgren
2007-08-13 13:49 ` [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect Tony Lindgren
2007-08-13 13:49 ` [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split Tony Lindgren
2007-08-13 13:49 ` [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine Tony Lindgren
2007-08-13 13:49 ` [PATCH 31/52] musb_hdrc: Search and replace bAddress with address Tony Lindgren
2007-08-13 13:49 ` [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr Tony Lindgren
2007-08-13 13:49 ` [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode Tony Lindgren
2007-08-13 13:49 ` [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver Tony Lindgren
2007-08-13 13:49 ` [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off Tony Lindgren
2007-08-13 13:49 ` [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry Tony Lindgren
2007-08-13 13:49 ` [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data Tony Lindgren
2007-08-13 13:49 ` [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len Tony Lindgren
2007-08-13 13:49 ` [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len Tony Lindgren
2007-08-13 13:49 ` [PATCH 40/52] musb_hdrc: Search and replace bStatus with status Tony Lindgren
2007-08-13 13:49 ` [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode Tony Lindgren
2007-08-13 13:49 ` [PATCH 42/52] musb_hdrc: Search and replace bMode with mode Tony Lindgren
2007-08-13 13:49 ` [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel Tony Lindgren
2007-08-13 13:49 ` [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest Tony Lindgren
2007-08-13 13:49 ` [PATCH 45/52] musb_hdrc: Search and replace bResult with result Tony Lindgren
2007-08-13 13:49 ` [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address Tony Lindgren
2007-08-13 13:49 ` [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip Tony Lindgren
2007-08-13 13:49 ` [PATCH 48/52] musb_hdrc: Search and replace pRequest with request Tony Lindgren
2007-08-13 13:49 ` [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr Tony Lindgren
2007-08-13 13:49 ` [PATCH 50/52] musb_hdrc: Search and replace bTx with tx Tony Lindgren
2007-08-13 13:49 ` Tony Lindgren [this message]
2007-08-13 13:49 ` [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum Tony Lindgren
2007-08-14 9:23 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren
2007-08-13 13:58 ` (no subject) Felipe Balbi
2007-08-14 8:06 ` musb CaMeLcAsEnOmOre (was: (no subject)) David Brownell
2007-08-14 8:55 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11870131044061-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap-open-source@linux.omap.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox