drivers/usb/dwc3/debug.h

Source file repositories/reference/linux-study-clean/drivers/usb/dwc3/debug.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/dwc3/debug.h
Extension
.h
Size
11058 bytes
Lines
451
Domain
Driver Families
Bucket
drivers/usb
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (epnum <= 1) {
			int phase = DEPEVT_STATUS_CONTROL_PHASE(event->status);

			switch (phase) {
			case DEPEVT_STATUS_CONTROL_DATA:
				scnprintf(str + len, size - len,
						" [Data Phase]");
				break;
			case DEPEVT_STATUS_CONTROL_STATUS:
				scnprintf(str + len, size - len,
						" [Status Phase]");
			}
		}
		break;
	case DWC3_DEPEVT_RXTXFIFOEVT:
		scnprintf(str + len, size - len, "FIFO");
		break;
	case DWC3_DEPEVT_STREAMEVT:
		status = event->status;

		switch (status) {
		case DEPEVT_STREAMEVT_FOUND:
			scnprintf(str + len, size - len, " Stream %d Found",
					event->parameters);
			break;
		case DEPEVT_STREAMEVT_NOTFOUND:
		default:
			scnprintf(str + len, size - len, " Stream Not Found");
			break;
		}

		break;
	case DWC3_DEPEVT_EPCMDCMPLT:
		scnprintf(str + len, size - len, "Endpoint Command Complete");
		break;
	default:
		scnprintf(str + len, size - len, "UNKNOWN");
	}

	return str;
}

/**
 * dwc3_gadget_event_type_string - return event name
 * @event: the event code
 */
static inline const char *dwc3_gadget_event_type_string(u8 event)
{
	switch (event) {
	case DWC3_DEVICE_EVENT_DISCONNECT:
		return "Disconnect";
	case DWC3_DEVICE_EVENT_RESET:
		return "Reset";
	case DWC3_DEVICE_EVENT_CONNECT_DONE:
		return "Connect Done";
	case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE:
		return "Link Status Change";
	case DWC3_DEVICE_EVENT_WAKEUP:
		return "Wake-Up";
	case DWC3_DEVICE_EVENT_HIBER_REQ:
		return "Hibernation";
	case DWC3_DEVICE_EVENT_SUSPEND:
		return "Suspend";
	case DWC3_DEVICE_EVENT_SOF:
		return "Start of Frame";
	case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
		return "Erratic Error";
	case DWC3_DEVICE_EVENT_CMD_CMPL:
		return "Command Complete";
	case DWC3_DEVICE_EVENT_OVERFLOW:
		return "Overflow";
	default:
		return "UNKNOWN";
	}
}

static inline const char *dwc3_decode_event(char *str, size_t size, u32 event,
		u32 ep0state)
{
	union dwc3_event evt;

	memcpy(&evt, &event, sizeof(event));

	if (evt.type.is_devspec)
		return dwc3_gadget_event_string(str, size, &evt.devt);
	else
		return dwc3_ep_event_string(str, size, &evt.depevt, ep0state);
}

static inline const char *dwc3_ep_cmd_status_string(int status)

Annotation

Implementation Notes