Skip to content

Commit 5a39e83

Browse files
yangsong8-a1xiaoxiang781216
authored andcommitted
usbdev: extend the usb req len to size_t
Some USB controllers can receive or send multiple data packets then generate one interrupt. This mechanism can reduce the number of data copies. Extend req buf to accommodate this. Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
1 parent 75eea1b commit 5a39e83

File tree

33 files changed

+83
-79
lines changed

33 files changed

+83
-79
lines changed

arch/arm/src/at32/at32_otgfsdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ static void at32_epin_request(struct at32_usbdev_s *priv,
13191319
return;
13201320
}
13211321

1322-
uinfo("EP%d req=%p: len=%d xfrd=%d zlp=%d\n",
1322+
uinfo("EP%d req=%p: len=%zu xfrd=%zu zlp=%d\n",
13231323
privep->epphy, privreq, privreq->req.len,
13241324
privreq->req.xfrd, privep->zlp);
13251325

@@ -1589,7 +1589,7 @@ static void at32_epout_complete(struct at32_usbdev_s *priv,
15891589
return;
15901590
}
15911591

1592-
uinfo("EP%d: len=%d xfrd=%d\n",
1592+
uinfo("EP%d: len=%zu xfrd=%zu\n",
15931593
privep->epphy, privreq->req.len, privreq->req.xfrd);
15941594

15951595
/* Return the completed read request to the class driver and mark the state
@@ -1745,7 +1745,7 @@ static inline void at32_epout_receive(struct at32_ep_s *privep,
17451745
return;
17461746
}
17471747

1748-
uinfo("EP%d: len=%d xfrd=%d\n",
1748+
uinfo("EP%d: len=%zu xfrd=%zu\n",
17491749
privep->epphy, privreq->req.len, privreq->req.xfrd);
17501750
usbtrace(TRACE_READ(privep->epphy), bcnt);
17511751

arch/arm/src/efm32/efm32_usbdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ static void efm32_epin_request(struct efm32_usbdev_s *priv,
12231223
return;
12241224
}
12251225

1226-
uinfo("EP%d req=%p: len=%d xfrd=%d zlp=%d\n",
1226+
uinfo("EP%d req=%p: len=%zu xfrd=%zu zlp=%d\n",
12271227
privep->epphy, privreq, privreq->req.len,
12281228
privreq->req.xfrd, privep->zlp);
12291229

@@ -1506,7 +1506,7 @@ static void efm32_epout_complete(struct efm32_usbdev_s *priv,
15061506
return;
15071507
}
15081508

1509-
uinfo("EP%d: len=%d xfrd=%d\n",
1509+
uinfo("EP%d: len=%zu xfrd=%zu\n",
15101510
privep->epphy, privreq->req.len, privreq->req.xfrd);
15111511

15121512
/* Return the completed read request to the class driver and mark the state
@@ -1638,7 +1638,7 @@ static inline void efm32_epout_receive(struct efm32_ep_s *privep,
16381638
return;
16391639
}
16401640

1641-
uinfo("EP%d: len=%d xfrd=%d\n",
1641+
uinfo("EP%d: len=%zu xfrd=%zu\n",
16421642
privep->epphy, privreq->req.len, privreq->req.xfrd);
16431643
usbtrace(TRACE_READ(privep->epphy), bcnt);
16441644

arch/arm/src/kinetis/kinetis_usbdev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,10 +970,10 @@ static void khci_wrcomplete(struct khci_usbdev_s *priv,
970970
epno = USB_EPNO(privep->ep.eplog);
971971

972972
#ifdef CONFIG_USBDEV_NOWRITEAHEAD
973-
uinfo("EP%d: len=%d xfrd=%d inflight=%d\n",
973+
uinfo("EP%d: len=%zu xfrd=%zu inflight=%d\n",
974974
epno, privreq->req.len, privreq->req.xfrd, privreq->inflight[0]);
975975
#else
976-
uinfo("EP%d: len=%d xfrd=%d inflight={%d, %d}\n",
976+
uinfo("EP%d: len=%zu xfrd=%zu inflight={%d, %d}\n",
977977
epno, privreq->req.len, privreq->req.xfrd,
978978
privreq->inflight[0], privreq->inflight[1]);
979979
#endif
@@ -1291,7 +1291,7 @@ static int khci_wrstart(struct khci_usbdev_s *priv,
12911291
bytesleft = privreq->req.len;
12921292
}
12931293

1294-
uinfo("epno=%d req=%p: len=%d xfrd=%d index=%d nullpkt=%d\n",
1294+
uinfo("epno=%d req=%p: len=%zu xfrd=%zu index=%d nullpkt=%d\n",
12951295
epno, privreq, privreq->req.len, xfrd, index, privep->txnullpkt);
12961296

12971297
/* Get the number of bytes left to be sent in the packet */
@@ -1406,7 +1406,7 @@ static int khci_rdcomplete(struct khci_usbdev_s *priv,
14061406
bdtout = privep->bdtout;
14071407
epno = USB_EPNO(privep->ep.eplog);
14081408

1409-
uinfo("EP%d: len=%d xfrd=%d\n",
1409+
uinfo("EP%d: len=%zu xfrd=%zu\n",
14101410
epno, privreq->req.len, privreq->req.xfrd);
14111411
bdtinfo("EP%d BDT OUT [%p] {%08x, %08x}\n",
14121412
epno, bdtout, bdtout->status, bdtout->addr);

arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ static int lpc17_40_wrrequest(struct lpc17_40_ep_s *privep)
10981098
return OK;
10991099
}
11001100

1101-
uinfo("epphy=%d req=%p: len=%d xfrd=%d nullpkt=%d\n",
1101+
uinfo("epphy=%d req=%p: len=%zu xfrd=%zu nullpkt=%d\n",
11021102
privep->epphy, privreq, privreq->req.len, privreq->req.xfrd,
11031103
privep->txnullpkt);
11041104

@@ -1208,7 +1208,7 @@ static int lpc17_40_rdrequest(struct lpc17_40_ep_s *privep)
12081208
return OK;
12091209
}
12101210

1211-
uinfo("len=%d xfrd=%d nullpkt=%d\n",
1211+
uinfo("len=%zu xfrd=%zu nullpkt=%d\n",
12121212
privreq->req.len, privreq->req.xfrd, privep->txnullpkt);
12131213

12141214
/* Ignore any attempt to receive a zero length packet */

arch/arm/src/lpc214x/lpc214x_usbdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep)
10351035
return OK;
10361036
}
10371037

1038-
uinfo("epphy=%d req=%p: len=%d xfrd=%d nullpkt=%d\n",
1038+
uinfo("epphy=%d req=%p: len=%zu xfrd=%zu nullpkt=%d\n",
10391039
privep->epphy, privreq, privreq->req.len, privreq->req.xfrd,
10401040
privep->txnullpkt);
10411041

@@ -1145,7 +1145,7 @@ static int lpc214x_rdrequest(struct lpc214x_ep_s *privep)
11451145
return OK;
11461146
}
11471147

1148-
uinfo("len=%d xfrd=%d nullpkt=%d\n",
1148+
uinfo("len=%zu xfrd=%zu nullpkt=%d\n",
11491149
privreq->req.len, privreq->req.xfrd, privep->txnullpkt);
11501150

11511151
/* Ignore any attempt to receive a zero length packet */

arch/arm/src/nrf52/nrf52_usbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ static void nrf52_epout_complete(struct nrf52_ep_s *privep)
12551255
return;
12561256
}
12571257

1258-
uinfo("EP%d: len=%d xfrd=%d\n", privep->epphy, privreq->req.len,
1258+
uinfo("EP%d: len=%zu xfrd=%zu\n", privep->epphy, privreq->req.len,
12591259
privreq->req.xfrd);
12601260

12611261
/* Return the completed read request to the class driver and mark the
@@ -1345,7 +1345,7 @@ static void nrf52_epout_receive(struct nrf52_ep_s *privep)
13451345
return;
13461346
}
13471347

1348-
uinfo("EP%d: len=%d xfrd=%d\n", privep->epphy,
1348+
uinfo("EP%d: len=%zu xfrd=%zu\n", privep->epphy,
13491349
privreq->req.len, privreq->req.xfrd);
13501350
usbtrace(TRACE_READ(privep->epphy), bcnt);
13511351

arch/arm/src/nrf53/nrf53_usbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ static void nrf53_epout_complete(struct nrf53_ep_s *privep)
12551255
return;
12561256
}
12571257

1258-
uinfo("EP%d: len=%d xfrd=%d\n", privep->epphy, privreq->req.len,
1258+
uinfo("EP%d: len=%zu xfrd=%zu\n", privep->epphy, privreq->req.len,
12591259
privreq->req.xfrd);
12601260

12611261
/* Return the completed read request to the class driver and mark the
@@ -1345,7 +1345,7 @@ static void nrf53_epout_receive(struct nrf53_ep_s *privep)
13451345
return;
13461346
}
13471347

1348-
uinfo("EP%d: len=%d xfrd=%d\n", privep->epphy,
1348+
uinfo("EP%d: len=%zu xfrd=%zu\n", privep->epphy,
13491349
privreq->req.len, privreq->req.xfrd);
13501350
usbtrace(TRACE_READ(privep->epphy), bcnt);
13511351

arch/arm/src/sam34/sam_udp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep)
941941
return -ENOENT;
942942
}
943943

944-
uinfo("epno=%d req=%p: len=%d xfrd=%d inflight=%d zlpneeded=%d\n",
944+
uinfo("epno=%d req=%p: len=%zu xfrd=%zu inflight=%d zlpneeded=%d\n",
945945
epno, privreq, privreq->req.len, privreq->req.xfrd,
946946
privreq->inflight, privep->zlpneeded);
947947

@@ -1113,7 +1113,7 @@ static int sam_req_read(struct sam_usbdev_s *priv, struct sam_ep_s *privep,
11131113
return -ENOENT;
11141114
}
11151115

1116-
uinfo("EP%d: len=%d xfrd=%d\n",
1116+
uinfo("EP%d: len=%zu xfrd=%zu\n",
11171117
epno, privreq->req.len, privreq->req.xfrd);
11181118

11191119
/* Ignore any attempt to receive a zero length packet */

arch/arm/src/sama5/sam_udphs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep)
13601360
return -ENOENT;
13611361
}
13621362

1363-
uinfo("epno=%d req=%p: len=%d xfrd=%d inflight=%d zlpneeded=%d\n",
1363+
uinfo("epno=%d req=%p: len=%zu xfrd=%zu inflight=%d zlpneeded=%d\n",
13641364
epno, privreq, privreq->req.len, privreq->req.xfrd,
13651365
privreq->inflight, privep->zlpneeded);
13661366

@@ -1604,7 +1604,7 @@ static int sam_req_read(struct sam_usbdev_s *priv, struct sam_ep_s *privep,
16041604
return -ENOENT;
16051605
}
16061606

1607-
uinfo("EP%d: len=%d xfrd=%d\n",
1607+
uinfo("EP%d: len=%zu xfrd=%zu\n",
16081608
epno, privreq->req.len, privreq->req.xfrd);
16091609

16101610
/* Ignore any attempt to receive a zero length packet */

arch/arm/src/samd2l2/sam_usb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep)
10861086
return -ENOENT;
10871087
}
10881088

1089-
uinfo("epno=%d req=%p: len=%d xfrd=%d inflight=%d\n",
1089+
uinfo("epno=%d req=%p: len=%zu xfrd=%zu inflight=%d\n",
10901090
epno, privreq, privreq->req.len, privreq->req.xfrd,
10911091
privreq->inflight);
10921092

@@ -1227,7 +1227,7 @@ static int sam_req_read(struct sam_usbdev_s *priv, struct sam_ep_s *privep,
12271227
return -ENOENT;
12281228
}
12291229

1230-
uinfo("EP%d: req.len=%d xfrd=%d recvsize=%d\n",
1230+
uinfo("EP%d: req.len=%zu xfrd=%zu recvsize=%d\n",
12311231
epno, privreq->req.len, privreq->req.xfrd, recvsize);
12321232

12331233
/* Ignore any attempt to receive a zero length packet */

0 commit comments

Comments
 (0)