Written by JP Embedded. Host controller (HCD), mass storage, and hub drivers. Change-Id: I4237cf7aeb4a1c0205a1876593a9cc67ef3d577e
		
			
				
	
	
		
			36 lines
		
	
	
		
			859 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			859 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Whatever is commonly used in hub driver, should be here
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _COMMON_H_
 | 
						|
#define _COMMON_H_
 | 
						|
 | 
						|
/*---------------------------*
 | 
						|
 *  commonly used headers:   *
 | 
						|
 *---------------------------*/
 | 
						|
#include <stdlib.h> /* For things, like EXIT_*, NULL, ... */
 | 
						|
#include <stdio.h>
 | 
						|
 | 
						|
/*---------------------------*
 | 
						|
 *  commonly used defines:   *
 | 
						|
 *---------------------------*/
 | 
						|
#define THIS_EXEC_NAME "usb_hub"
 | 
						|
#define HUB_MSG(...) do {						\
 | 
						|
	printf(THIS_EXEC_NAME": ");					\
 | 
						|
	printf(__VA_ARGS__);						\
 | 
						|
	printf("; %s:%d\n", __func__, __LINE__);			\
 | 
						|
	} while(0)
 | 
						|
 | 
						|
/*---------------------------*
 | 
						|
 *  debug helpers:           *
 | 
						|
 *---------------------------*/
 | 
						|
#ifdef HUB_DEBUG
 | 
						|
#define HUB_DEBUG_MSG		HUB_MSG
 | 
						|
#define HUB_DEBUG_DUMP		printf("%s():%d\n", __func__, __LINE__)
 | 
						|
#else
 | 
						|
#define HUB_DEBUG_MSG(...)
 | 
						|
#define HUB_DEBUG_DUMP
 | 
						|
#endif
 | 
						|
 | 
						|
#endif /* !_COMMON_H_ */
 |