@@ -3109,6 +3109,7 @@ static int cdns3_init_eps(struct cdns3_device *priv_dev)
priv_ep->num = ep_number;
priv_ep->dir = ep_dir ? USB_DIR_IN : USB_DIR_OUT;
+ priv_ep->endpoint.epnum = ep_number;
if (!ep_number) {
ret = cdns3_init_ep0(priv_dev, priv_ep);
if (ret) {
@@ -1622,6 +1622,7 @@ static int cdnsp_gadget_init_endpoints(struct cdnsp_device *pdev)
pep->number = epnum;
pep->direction = direction; /* 0 for OUT, 1 for IN. */
+ pep->endpoint.epnum = epnum;
/*
* Ep0 is bidirectional, so ep0in and ep0out are represented by
* pdev->eps[0]
@@ -1857,6 +1857,7 @@ static int init_eps(struct ci_hdrc *ci)
hwep->lock = &ci->lock;
hwep->td_pool = ci->td_pool;
+ hwep->ep.epnum = i;
hwep->ep.name = hwep->name;
hwep->ep.ops = &usb_ep_ops;
@@ -4805,7 +4805,7 @@ static void dwc2_hsotg_initep(struct dwc2_hsotg *hsotg,
INIT_LIST_HEAD(&hs_ep->queue);
INIT_LIST_HEAD(&hs_ep->ep.ep_list);
-
+ hs_ep->ep.epnum = epnum;
/* add to the list of endpoints known by the gadget driver */
if (epnum)
list_add_tail(&hs_ep->ep.ep_list, &hsotg->gadget.ep_list);
@@ -3267,6 +3267,7 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum)
dep->endpoint.name = dep->name;
+ dep->endpoint.epnum = num;
if (!(dep->number > 1)) {
dep->endpoint.desc = &dwc3_gadget_ep0_desc;
dep->endpoint.comp_desc = NULL;
@@ -1238,6 +1238,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg)
ep->fotg210 = fotg210;
INIT_LIST_HEAD(&ep->queue);
ep->ep.name = fotg210_ep_name[i];
+ ep->ep.epnum = i;
ep->ep.ops = &fotg210_ep_ops;
usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0);
@@ -825,6 +825,7 @@ struct ast_vhub_ep *ast_vhub_alloc_epn(struct ast_vhub_dev *d, u8 addr)
ep->d_idx = addr;
ep->vhub = vhub;
ep->ep.ops = &ast_vhub_epn_ops;
+ ep->ep.epnum = addr;
ep->ep.name = kasprintf(GFP_KERNEL, "ep%d", addr);
d->epns[addr-1] = ep;
ep->epn.g_idx = i;
@@ -1355,6 +1355,7 @@ static void ast_udc_init_ep(struct ast_udc_dev *udc)
for (i = 0; i < AST_UDC_NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
+ ep->ep.epnum = i;
ep->ep.name = ast_ep_name[i];
if (i == 0) {
ep->ep.caps.type_control = true;
@@ -1819,6 +1819,7 @@ static int at91udc_probe(struct platform_device *pdev)
for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
+ ep->ep.epnum = i;
ep->ep.name = ep_info[i].name;
ep->ep.caps = ep_info[i].caps;
ep->ep.ops = &at91_ep_ops;
@@ -2217,6 +2217,7 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
ep->can_dma = ep_cfg->can_dma;
ep->can_isoc = ep_cfg->can_isoc;
+ ep->ep.epnum = ep->index;
sprintf(ep->name, "ep%d", ep->index);
ep->ep.name = ep->name;
@@ -952,6 +952,7 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc)
for (i = 0; i < BCM63XX_NUM_EP; i++) {
struct bcm63xx_ep *bep = &udc->bep[i];
+ bep->ep.epnum = i;
bep->ep.name = bcm63xx_ep_info[i].name;
bep->ep.caps = bcm63xx_ep_info[i].caps;
bep->ep_num = i;
@@ -1977,6 +1977,7 @@ static int init_ep(struct bdc *bdc, u32 epnum, u32 dir)
snprintf(ep->name, sizeof(ep->name), "ep%d%s", epnum - 1,
dir & 1 ? "in" : "out");
+ ep->usb_ep.epnum = epnum - 1;
usb_ep_set_maxpacket_limit(&ep->usb_ep, 1024);
ep->usb_ep.caps.type_iso = true;
ep->usb_ep.caps.type_bulk = true;
@@ -2213,7 +2213,7 @@ static int cdns2_init_eps(struct cdns2_device *pdev)
} else {
snprintf(pep->name, sizeof(pep->name), "ep%d%s",
epnum, !!direction ? "in" : "out");
- pep->endpoint.name = pep->name;
+ pep->endpoint.epnum = epnum;
usb_ep_set_maxpacket_limit(&pep->endpoint, 1024);
pep->endpoint.ops = &cdns2_gadget_ep_ops;
@@ -1049,6 +1049,7 @@ static void init_dummy_udc_hw(struct dummy *dum)
if (!ep_info[i].name)
break;
+ ep->ep.epnum = i;
ep->ep.name = ep_info[i].name;
ep->ep.caps = ep_info[i].caps;
ep->ep.ops = &dummy_ep_ops;
@@ -2411,6 +2411,7 @@ static int qe_ep_config(struct qe_udc *udc, unsigned char pipe_num)
ep->udc = udc;
strcpy(ep->name, ep_name[pipe_num]);
ep->ep.name = ep_name[pipe_num];
+ ep->ep.epnum = pipe_num;
if (pipe_num == 0) {
ep->ep.caps.type_control = true;
@@ -2331,6 +2331,7 @@ static int struct_ep_setup(struct fsl_udc *udc, unsigned char index,
else
ep->ep.caps.dir_out = true;
+ ep->ep.epunm = index / 2;
/* for ep0: maxP defined in desc
* for other eps, maxP is set by epautoconfig() called by gadget layer
*/
@@ -1445,6 +1445,7 @@ static int fusb300_probe(struct platform_device *pdev)
}
ep->fusb300 = fusb300;
INIT_LIST_HEAD(&ep->queue);
+ ep->ep.epnum = i;
ep->ep.name = fusb300_ep_name[i];
ep->ep.ops = &fusb300_ep_ops;
usb_ep_set_maxpacket_limit(&ep->ep, HS_BULK_MAX_PACKET_SIZE);
@@ -1266,6 +1266,7 @@ static void udc_reinit (struct goku_udc *dev)
struct goku_ep *ep = &dev->ep[i];
ep->num = i;
+ ep->ep.epnum = i;
ep->ep.name = names[i];
ep->reg_fifo = &dev->regs->ep_fifo [i];
ep->reg_status = &dev->regs->ep_status [i];
@@ -1976,6 +1976,7 @@ static int gr_ep_init(struct gr_udc *dev, int num, int is_in, u32 maxplimit)
ep->num = num;
ep->is_in = is_in;
ep->dev = dev;
+ ep->ep.epnum = num;
ep->ep.ops = &gr_ep_ops;
INIT_LIST_HEAD(&ep->queue);
@@ -1385,6 +1385,7 @@ static void udc_reinit(struct lpc32xx_udc *udc)
if (i != 0)
list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
+ ep->ep.epnum = i;
usb_ep_set_maxpacket_limit(&ep->ep, ep->maxpacket);
INIT_LIST_HEAD(&ep->queue);
ep->req_pending = 0;
@@ -1622,6 +1622,7 @@ static int m66592_probe(struct platform_device *pdev)
}
ep->m66592 = m66592;
INIT_LIST_HEAD(&ep->queue);
+ ep->ep.epnum = i;
ep->ep.name = m66592_ep_name[i];
ep->ep.ops = &m66592_ep_ops;
usb_ep_set_maxpacket_limit(&ep->ep, 512);
@@ -1162,6 +1162,7 @@ static void max3420_eps_init(struct max3420_udc *udc)
ep->id = idx;
ep->halted = 0;
ep->maxpacket = 0;
+ ep->ep_usb.epnum = idx;
ep->ep_usb.name = ep->name;
ep->ep_usb.ops = &max3420_ep_ops;
usb_ep_set_maxpacket_limit(&ep->ep_usb, MAX3420_EP_MAX_PACKET);
@@ -1308,6 +1308,7 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d)
ep = &u3d->eps[1];
ep->u3d = u3d;
strncpy(ep->name, "ep0", sizeof(ep->name));
+ ep->ep.epnum = 0;
ep->ep.name = ep->name;
ep->ep.ops = &mv_u3d_ep_ops;
ep->wedge = 0;
@@ -1339,6 +1340,7 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d)
ep->u3d = u3d;
strncpy(ep->name, name, sizeof(ep->name));
ep->ep.name = ep->name;
+ ep->ep.epnum = i / 2;
ep->ep.caps.type_iso = true;
ep->ep.caps.type_bulk = true;
@@ -1244,6 +1244,7 @@ static int eps_init(struct mv_udc *udc)
ep = &udc->eps[0];
ep->udc = udc;
strncpy(ep->name, "ep0", sizeof(ep->name));
+ ep->ep.epnum = 0;
ep->ep.name = ep->name;
ep->ep.ops = &mv_ep_ops;
ep->wedge = 0;
@@ -1273,6 +1274,7 @@ static int eps_init(struct mv_udc *udc)
ep->udc = udc;
strncpy(ep->name, name, sizeof(ep->name));
ep->ep.name = ep->name;
+ ep->ep.epnum = i / 2;
ep->ep.caps.type_iso = true;
ep->ep.caps.type_bulk = true;
@@ -1373,6 +1373,7 @@ net2272_usb_reinit(struct net2272 *dev)
struct net2272_ep *ep = &dev->ep[i];
ep->ep.name = ep_name[i];
+ ep->ep.epnum = i;
ep->dev = dev;
ep->num = i;
ep->not_empty = 0;
@@ -2158,6 +2158,7 @@ static void usb_reinit_228x(struct net2280 *dev)
ep->ep.name = ep_info_dft[tmp].name;
ep->ep.caps = ep_info_dft[tmp].caps;
+ ep->ep.epnum = tmp;
ep->dev = dev;
ep->num = tmp;
@@ -2201,6 +2202,7 @@ static void usb_reinit_338x(struct net2280 *dev)
ep_info_dft[i].name;
ep->ep.caps = dev->enhanced_mode ? ep_info_adv[i].caps :
ep_info_dft[i].caps;
+ ep->ep.epnum = i;
ep->dev = dev;
ep->num = i;
@@ -2582,6 +2582,7 @@ omap_ep_setup(char *name, u8 addr, u8 type,
else
ep->ep.caps.dir_out = true;
+ ep->ep.epnum = addr & 0xf;
ep->ep.name = ep->name;
ep->ep.ops = &omap_ep_ops;
ep->maxpacket = maxp;
@@ -2788,6 +2788,7 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev)
ep->halted = 1;
ep->num = i / 2;
ep->in = ~i & 1;
+ ep->ep.epnum = i / 2;
ep->ep.name = ep_string[i];
ep->ep.ops = &pch_udc_ep_ops;
if (ep->in) {
@@ -1392,6 +1392,7 @@ static void udc_reinit(struct pxa25x_udc *dev)
if (i != 0)
list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list);
+ ep->ep.epnum = i;
ep->ep.desc = NULL;
ep->stopped = 0;
INIT_LIST_HEAD (&ep->queue);
@@ -1677,6 +1677,7 @@ static void udc_init_data(struct pxa_udc *dev)
/* USB endpoints init */
for (i = 1; i < NR_USB_ENDPOINTS; i++) {
+ dev->udc_usb_ep[i].usb_ep.epnum = i;
list_add_tail(&dev->udc_usb_ep[i].usb_ep.ep_list,
&dev->gadget.ep_list);
usb_ep_set_maxpacket_limit(&dev->udc_usb_ep[i].usb_ep,
@@ -1912,6 +1912,7 @@ static int r8a66597_probe(struct platform_device *pdev)
}
ep->r8a66597 = r8a66597;
INIT_LIST_HEAD(&ep->queue);
+ ep->ep.epnum = i;
ep->ep.name = r8a66597_ep_name[i];
ep->ep.ops = &r8a66597_ep_ops;
usb_ep_set_maxpacket_limit(&ep->ep, 512);
@@ -2700,6 +2700,7 @@ static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev,
snprintf(usb3_ep->ep_name, sizeof(usb3_ep->ep_name), "ep%d", i);
usb3_ep->usb3 = usb3;
usb3_ep->num = i;
+ usb3_ep->ep.epnum = i;
usb3_ep->ep.name = usb3_ep->ep_name;
usb3_ep->ep.ops = &renesas_usb3_ep_ops;
INIT_LIST_HEAD(&usb3_ep->queue);
@@ -3308,6 +3308,7 @@ static int usbf_probe(struct platform_device *pdev)
ep->id = i;
ep->disabled = 1;
ep->udc = udc;
+ ep->ep.epnum = i;
ep->ep.ops = &usbf_ep_ops;
ep->ep.name = usbf_ep_info[i].name;
ep->ep.caps = usbf_ep_info[i].caps;
@@ -1538,6 +1538,7 @@ static void udc_setup_endpoints(struct udc *dev)
for (tmp = 0; tmp < UDC_EP_NUM; tmp++) {
ep = &dev->ep[tmp];
ep->dev = dev;
+ ep->ep.epnum = tmp;
ep->ep.name = ep_info[tmp].name;
ep->ep.caps = ep_info[tmp].caps;
ep->num = tmp;
@@ -3173,6 +3173,7 @@ static int tegra_xudc_alloc_ep(struct tegra_xudc *xudc, unsigned int index)
if (index) {
snprintf(ep->name, sizeof(ep->name), "ep%u%s", index / 2,
(index % 2 == 0) ? "out" : "in");
+ ep->ep.epnum = index / 2;
ep->usb_ep.name = ep->name;
usb_ep_set_maxpacket_limit(&ep->usb_ep, 1024);
ep->usb_ep.max_streams = 16;
@@ -3186,6 +3187,7 @@ static int tegra_xudc_alloc_ep(struct tegra_xudc *xudc, unsigned int index)
list_add_tail(&ep->usb_ep.ep_list, &xudc->gadget.ep_list);
} else {
strscpy(ep->name, "ep0", 3);
+ ep->ep.epnum = 0;
ep->usb_ep.name = ep->name;
usb_ep_set_maxpacket_limit(&ep->usb_ep, 512);
ep->usb_ep.ops = &tegra_xudc_ep0_ops;
@@ -1324,6 +1324,7 @@ static void xudc_eps_init(struct xusb_udc *udc)
ep->ep_usb.caps.type_control = true;
}
+ ep->ep_usb.epnum = ep_number;
ep->ep_usb.caps.dir_in = true;
ep->ep_usb.caps.dir_out = true;
@@ -1466,6 +1466,7 @@ static void isp1760_udc_init_eps(struct isp1760_udc *udc)
ep->ep.ops = &isp1760_ep_ops;
ep->ep.name = ep->name;
+ ep->ep.epnum = ep_num;
/*
* Hardcode the maximum packet sizes for now, to 64 bytes for
* the control endpoint and 512 bytes for all other endpoints.
@@ -655,6 +655,7 @@ static void init_hw_ep(struct mtu3 *mtu, struct mtu3_ep *mep,
sprintf(mep->name, "ep%d%s", epnum,
!epnum ? "" : (is_in ? "in" : "out"));
+ mep->ep.epnum = epnum;
mep->ep.name = mep->name;
INIT_LIST_HEAD(&mep->ep.ep_list);
@@ -1709,6 +1709,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
(!epnum || hw_ep->is_shared_fifo) ? "" : (
is_in ? "in" : "out"));
ep->end_point.name = ep->name;
+ ep->end_point.epnum = epnum;
INIT_LIST_HEAD(&ep->end_point.ep_list);
if (!epnum) {
usb_ep_set_maxpacket_limit(&ep->end_point, 64);
@@ -1139,6 +1139,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
uep->pipe = NULL;
snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i);
+ uep->ep.epnum = i;
uep->ep.name = uep->ep_name;
uep->ep.ops = &usbhsg_ep_ops;
INIT_LIST_HEAD(&uep->ep.ep_list);
@@ -535,6 +535,7 @@ static int init_vudc_hw(struct vudc *udc)
i ? (is_out ? "out" : "in") : "");
ep->ep.name = ep->name;
+ ep->ep.epnum = num;
ep->ep.ops = &vep_ops;
usb_ep_set_maxpacket_limit(&ep->ep, ~0);
When record trace event in UDC core layer, it will reduce trace ring buffer usage if record one u32 variable including epnum, use USB_EP_NAME() macro will generate endpoint name from epnum. Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com> --- drivers/usb/cdns3/cdns3-gadget.c | 1 + drivers/usb/cdns3/cdnsp-gadget.c | 1 + drivers/usb/chipidea/udc.c | 1 + drivers/usb/dwc2/gadget.c | 2 +- drivers/usb/dwc3/gadget.c | 1 + drivers/usb/fotg210/fotg210-udc.c | 1 + drivers/usb/gadget/udc/aspeed-vhub/epn.c | 1 + drivers/usb/gadget/udc/aspeed_udc.c | 1 + drivers/usb/gadget/udc/at91_udc.c | 1 + drivers/usb/gadget/udc/atmel_usba_udc.c | 1 + drivers/usb/gadget/udc/bcm63xx_udc.c | 1 + drivers/usb/gadget/udc/bdc/bdc_ep.c | 1 + drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 2 +- drivers/usb/gadget/udc/dummy_hcd.c | 1 + drivers/usb/gadget/udc/fsl_qe_udc.c | 1 + drivers/usb/gadget/udc/fsl_udc_core.c | 1 + drivers/usb/gadget/udc/fusb300_udc.c | 1 + drivers/usb/gadget/udc/goku_udc.c | 1 + drivers/usb/gadget/udc/gr_udc.c | 1 + drivers/usb/gadget/udc/lpc32xx_udc.c | 1 + drivers/usb/gadget/udc/m66592-udc.c | 1 + drivers/usb/gadget/udc/max3420_udc.c | 1 + drivers/usb/gadget/udc/mv_u3d_core.c | 2 ++ drivers/usb/gadget/udc/mv_udc_core.c | 2 ++ drivers/usb/gadget/udc/net2272.c | 1 + drivers/usb/gadget/udc/net2280.c | 2 ++ drivers/usb/gadget/udc/omap_udc.c | 1 + drivers/usb/gadget/udc/pch_udc.c | 1 + drivers/usb/gadget/udc/pxa25x_udc.c | 1 + drivers/usb/gadget/udc/pxa27x_udc.c | 1 + drivers/usb/gadget/udc/r8a66597-udc.c | 1 + drivers/usb/gadget/udc/renesas_usb3.c | 1 + drivers/usb/gadget/udc/renesas_usbf.c | 1 + drivers/usb/gadget/udc/snps_udc_core.c | 1 + drivers/usb/gadget/udc/tegra-xudc.c | 2 ++ drivers/usb/gadget/udc/udc-xilinx.c | 1 + drivers/usb/isp1760/isp1760-udc.c | 1 + drivers/usb/mtu3/mtu3_gadget.c | 1 + drivers/usb/musb/musb_gadget.c | 1 + drivers/usb/renesas_usbhs/mod_gadget.c | 1 + drivers/usb/usbip/vudc_dev.c | 1 + 41 files changed, 45 insertions(+), 2 deletions(-)