本文整理汇总了C++中DWC_DEBUGPL函数的典型用法代码示例。如果您正苦于以下问题:C++ DWC_DEBUGPL函数的具体用法?C++ DWC_DEBUGPL怎么用?C++ DWC_DEBUGPL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DWC_DEBUGPL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dwc_usb_gadget_stop
/**
* This function unregisters a gadget driver
*
* @param driver The driver being unregistered
*/
static int dwc_usb_gadget_stop(struct usb_gadget *gadget, struct usb_gadget_driver *driver)
{
//DWC_DEBUGPL(DBG_PCDV,"%s(%p)\n", __func__, _driver);
if (gadget_wrapper == 0) {
DWC_DEBUGPL(DBG_ANY, "%s Return(%d): s_pcd==0\n", __func__,
-ENODEV);
return -ENODEV;
}
if (driver == 0 || driver != gadget_wrapper->driver) {
DWC_DEBUGPL(DBG_ANY, "%s Return(%d): driver?\n", __func__,
-EINVAL);
return -EINVAL;
}
gadget_wrapper->driver = 0;
gadget_wrapper->enabled = 0;
DWC_DEBUGPL(DBG_ANY, "unregistered driver '%s'\n", driver->driver.name);
return 0;
}
示例2: dwc_otg_pcd_free_request
/**
* This function frees a request object.
*
* @param ep The endpoint associated with the request
* @param req The request being freed
*/
static void dwc_otg_pcd_free_request(struct usb_ep *ep, struct usb_request *req)
{
DWC_DEBUGPL(DBG_PCDV, "%s(%p,%p)\n", __func__, ep, req);
if (0 == ep || 0 == req) {
DWC_WARN("%s() %s\n", __func__,
"Invalid ep or req argument!\n");
return;
}
kfree(req);
}
示例3: hcd_start
/** Initializes the DWC_otg controller and its root hub and prepares it for host
* mode operation. Activates the root port. Returns 0 on success and a negative
* error code on failure. */
int hcd_start(struct usb_hcd *hcd)
{
dwc_otg_hcd_t *dwc_otg_hcd = hcd_to_dwc_otg_hcd(hcd);
struct usb_bus *bus;
DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD START\n");
bus = hcd_to_bus(hcd);
hcd->state = HC_STATE_RUNNING;
if (dwc_otg_hcd_start(dwc_otg_hcd, &hcd_fops)) {
return 0;
}
/* Initialize and connect root hub if one is not already attached */
if (bus->root_hub) {
DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD Has Root Hub\n");
/* Inform the HUB driver to resume. */
usb_hcd_resume_root_hub(hcd);
}
return 0;
}
示例4: get_frame_number
/**
*Gets the USB Frame number of the last SOF.
*/
static int get_frame_number(struct usb_gadget *gadget)
{
struct gadget_wrapper *d;
DWC_DEBUGPL(DBG_PCDV, "%s(%p)\n", __func__, gadget);
if (gadget == 0) {
return -ENODEV;
}
d = container_of(gadget, struct gadget_wrapper, gadget);
return dwc_otg_pcd_get_frame_number(d->pcd);
}
示例5: request_done
/**
* This function completes a request. It call's the request call back.
*/
void request_done(dwc_otg_pcd_ep_t * _ep, dwc_otg_pcd_request_t * _req,
int _status)
{
unsigned stopped = _ep->stopped;
dwc_otg_core_if_t *core_if = GET_CORE_IF(_ep->pcd);
DWC_DEBUGPL(DBG_PCDV, "%s(%p)\n", __func__, _ep);
if(_ep->dwc_ep.num && _ep->dwc_ep.is_in)
list_del_init(&_req->pcd_queue);
list_del_init(&_req->queue);
if (_req->req.status == -EINPROGRESS) {
_req->req.status = _status;
} else {
_status = _req->req.status;
}
/* don't modify queue heads during completion callback */
_ep->stopped = 1;
SPIN_UNLOCK(&_ep->pcd->lock);
_req->req.complete(&_ep->ep, &_req->req);
SPIN_LOCK(&_ep->pcd->lock);
if (_ep->pcd->request_pending > 0) {
--_ep->pcd->request_pending;
}
_ep->stopped = stopped;
if(_ep->dwc_ep.is_in && _ep->dwc_ep.num){
DWC_DEBUGPL(DBG_PCDV, "ep%d,len=%d\n",_ep->dwc_ep.num,_req->req.actual);
_ep->pcd->ep_in_sync = 0;
}
if(core_if->dma_enable)
dwc_otg_pcd_dma_unmap(&_ep->dwc_ep);
}
示例6: deschedule_periodic
/**
* Removes an interrupt or isochronous transfer from the periodic schedule.
*
* @param hcd The HCD state structure for the DWC OTG controller.
* @param qh QH for the periodic transfer.
*/
static void deschedule_periodic(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh)
{
list_del_init(&qh->qh_list_entry);
/* Release the periodic channel reservation. */
hcd->periodic_channels--;
/* Update claimed usecs per (micro)frame. */
hcd->periodic_usecs -= qh->usecs;
/* Update average periodic bandwidth claimed and # periodic reqs for usbfs. */
hcd_to_bus(dwc_otg_hcd_to_hcd(hcd))->bandwidth_allocated -= qh->usecs / qh->interval;
if (qh->ep_type == USB_ENDPOINT_XFER_INT) {
hcd_to_bus(dwc_otg_hcd_to_hcd(hcd))->bandwidth_int_reqs--;
DWC_DEBUGPL(DBG_HCD, "Descheduled intr: qh %p, usecs %d, period %d\n",
qh, qh->usecs, qh->interval);
} else {
hcd_to_bus(dwc_otg_hcd_to_hcd(hcd))->bandwidth_isoc_reqs--;
DWC_DEBUGPL(DBG_HCD, "Descheduled isoc: qh %p, usecs %d, period %d\n",
qh, qh->usecs, qh->interval);
}
}
示例7: wakeup
/**
* Initiates Session Request Protocol (SRP) to wakeup the host if no
* session is in progress. If a session is already in progress, but
* the device is suspended, remote wakeup signaling is started.
*
*/
static int wakeup(struct usb_gadget *gadget)
{
struct gadget_wrapper *d;
DWC_DEBUGPL(DBG_PCDV, "%s(%p)\n", __func__, gadget);
if (gadget == 0) {
return -ENODEV;
} else {
d = container_of(gadget, struct gadget_wrapper, gadget);
}
dwc_otg_pcd_wakeup(d->pcd);
return 0;
}
示例8: ep_queue
/**
* This function is used to submit an I/O Request to an EP.
*
* - When the request completes the request's completion callback
* is called to return the request to the driver.
* - An EP, except control EPs, may have multiple requests
* pending.
* - Once submitted the request cannot be examined or modified.
* - Each request is turned into one or more packets.
* - A BULK EP can queue any amount of data; the transfer is
* packetized.
* - Zero length Packets are specified with the request 'zero'
* flag.
*/
static int ep_queue(struct usb_ep *usb_ep, struct usb_request *usb_req,
gfp_t gfp_flags)
{
dwc_otg_pcd_t *pcd;
int retval = 0;
//trace_printk("(%p,%p,%d)\n",
// usb_ep, usb_req, gfp_flags);
if (!usb_req || !usb_req->complete ||
(!gadget_wrapper->gadget.sg_supported &&
!usb_req->buf)) {
DWC_WARN("bad params\n");
return -EINVAL;
}
if (!usb_ep) {
DWC_WARN("bad ep\n");
return -EINVAL;
}
pcd = gadget_wrapper->pcd;
if (!gadget_wrapper->driver ||
gadget_wrapper->gadget.speed == USB_SPEED_UNKNOWN) {
DWC_DEBUGPL(DBG_PCDV, "gadget.speed=%d\n",
gadget_wrapper->gadget.speed);
DWC_WARN("bogus device state\n");
return -ESHUTDOWN;
}
//trace_printk( "%s queue req %p, len %d buf %p\n",
// usb_ep->name, usb_req, usb_req->length, usb_req->buf);
usb_req->status = -EINPROGRESS;
usb_req->actual = 0;
retval = dwc_otg_pcd_ep_queue(pcd, usb_ep, usb_req->buf, usb_req->dma/*dma_addr*/,
usb_req->length, usb_req->zero, usb_req->num_sgs,
usb_req->sg, usb_req, gfp_flags == GFP_ATOMIC ? 1 : 0);
if (retval) {
pr_err("%s, cannot enqueue a renquest, err :%d\n", __func__,
retval);
pr_info( "%s queue req %p, len %d buf %p\n",
usb_ep->name, usb_req, usb_req->length, usb_req->buf);
return -EINVAL;
}
return 0;
}
示例9: dwc_otg_pcd_free_request
/**
* This function frees a request object.
*
* @param _ep The endpoint associated with the request
* @param _req The request being freed
*/
static void dwc_otg_pcd_free_request(struct usb_ep *_ep,
struct usb_request *_req)
{
dwc_otg_pcd_request_t *req;
DWC_DEBUGPL(DBG_PCDV,"%s(%p,%p)\n", __func__, _ep, _req);
if (0 == _ep || 0 == _req) {
DWC_WARN("%s() %s\n", __func__,
"Invalid ep or req argument!\n");
return;
}
req = container_of(_req, dwc_otg_pcd_request_t, req);
kfree(req);
}
示例10: dwc_otg_pcd_free_buffer
/**
* This function frees an I/O buffer that was allocated by alloc_buffer.
*
* @param _ep the endpoint associated with the buffer
* @param _buf address of the buffer
* @param _dma The buffer's DMA address
* @param _bytes The number of bytes of the buffer
*/
static void dwc_otg_pcd_free_buffer(struct usb_ep *_ep, void *_buf,
dma_addr_t _dma, unsigned _bytes)
{
dwc_otg_pcd_ep_t *ep;
dwc_otg_pcd_t *pcd = 0;
ep = container_of(_ep, dwc_otg_pcd_ep_t, ep);
pcd = ep->pcd;
DWC_DEBUGPL(DBG_PCDV, "%s(%p,%p,%0x,%d)\n", __func__, _ep, _buf, _dma,
_bytes);
if (GET_CORE_IF(pcd)->dma_enable) {
dma_free_coherent(NULL, _bytes, _buf, _dma);
} else {
kfree(_buf);
}
}
示例11: ep_dequeue
/**
* This function cancels an I/O request from an EP.
*/
static int ep_dequeue(struct usb_ep *usb_ep, struct usb_request *usb_req)
{
DWC_DEBUGPL(DBG_PCDV, "%s(%p,%p)\n", __func__, usb_ep, usb_req);
if (!usb_ep || !usb_req) {
DWC_WARN("bad argument\n");
return -EINVAL;
}
if (!gadget_wrapper->driver ||
gadget_wrapper->gadget.speed == USB_SPEED_UNKNOWN) {
DWC_WARN("bogus device state\n");
return -ESHUTDOWN;
}
if (dwc_otg_pcd_ep_dequeue(gadget_wrapper->pcd, usb_ep, usb_req)) {
return -EINVAL;
}
return 0;
}
示例12: ep_halt
/**
* usb_ep_set_halt stalls an endpoint.
*
* usb_ep_clear_halt clears an endpoint halt and resets its data
* toggle.
*
* Both of these functions are implemented with the same underlying
* function. The behavior depends on the value argument.
*
* @param[in] usb_ep the Endpoint to halt or clear halt.
* @param[in] value
* - 0 means clear_halt.
* - 1 means set_halt,
* - 2 means clear stall lock flag.
* - 3 means set stall lock flag.
*/
static int ep_halt(struct usb_ep *usb_ep, int value)
{
int retval = 0;
DWC_DEBUGPL(DBG_PCD, "HALT %s %d\n", usb_ep->name, value);
if (!usb_ep) {
DWC_WARN("bad ep\n");
return -EINVAL;
}
retval = dwc_otg_pcd_ep_halt(gadget_wrapper->pcd, usb_ep, value);
if (retval == -DWC_E_AGAIN) {
return -EAGAIN;
} else if (retval) {
retval = -EINVAL;
}
return retval;
}
示例13: pcd_remove
/**
* Cleanup the PCD.
*/
void pcd_remove(struct platform_device *_dev)
{
dwc_otg_device_t *otg_dev = platform_get_otgdata(_dev);
dwc_otg_pcd_t *pcd = otg_dev->pcd;
int irq;
DWC_DEBUGPL(DBG_PCDV, "%s(%p)\n", __func__, _dev);
/*
* Free the IRQ
*/
irq = platform_get_irq(_dev, 0);
if(irq >= 0) {
free_irq(irq, pcd);
}
dwc_otg_pcd_remove(otg_dev->pcd);
free_wrapper(gadget_wrapper);
otg_dev->pcd = 0;
}
示例14: ep_wedge
/**
* ep_wedge: sets the halt feature and ignores clear requests
*
* @usb_ep: the endpoint being wedged
*
* Use this to stall an endpoint and ignore CLEAR_FEATURE(HALT_ENDPOINT)
* requests. If the gadget driver clears the halt status, it will
* automatically unwedge the endpoint.
*
* Returns zero on success, else negative errno. *
* Check usb_ep_set_wedge() at "usb_gadget.h" for details
*/
static int ep_wedge(struct usb_ep *usb_ep)
{
int retval = 0;
DWC_DEBUGPL(DBG_PCD, "WEDGE %s\n", usb_ep->name);
if (!usb_ep) {
DWC_WARN("bad ep\n");
return -EINVAL;
}
retval = dwc_otg_pcd_ep_wedge(gadget_wrapper->pcd, usb_ep);
if (retval == -DWC_E_AGAIN) {
retval = -EAGAIN;
} else if (retval) {
retval = -EINVAL;
}
return retval;
}
示例15: DWC_DEBUGPL
/**
* This function allocates a request object to use with the specified
* endpoint.
*
* @param ep The endpoint to be used with with the request
* @param gfp_flags the GFP_* flags to use.
*/
static struct usb_request *dwc_otg_pcd_alloc_request(struct usb_ep *ep,
gfp_t gfp_flags)
{
struct usb_request *usb_req;
DWC_DEBUGPL(DBG_PCDV, "%s(%p,%d)\n", __func__, ep, gfp_flags);
if (0 == ep) {
DWC_WARN("%s() %s\n", __func__, "Invalid EP!\n");
return 0;
}
usb_req = kmalloc(sizeof(*usb_req), gfp_flags);
if (0 == usb_req) {
DWC_WARN("%s() %s\n", __func__, "request allocation failed!\n");
return 0;
}
memset(usb_req, 0, sizeof(*usb_req));
usb_req->dma = DWC_INVALID_DMA_ADDR;
return usb_req;
}