⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usblink.h

📁 Usb Host/Periphel Control TD1120 codes
💻 H
字号:
/*-----------------------------------------------------------------------------
$File: //hodad/usblink/3.4/project/linux_2_4_9/hc_int_242/usblink.h $
$DateTime: 2003/12/01 16:04:41 $
$Revision: #1 $
Purpose:   Project specific files and constant definitions

CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.

THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.

Copyright (c) 1999 - 2003 by SoftConnex Technologies, Inc. 

This software is protected by copyright laws and international copyright 
treaties, as well as other intellectual property laws and treaties.  This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions 
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA 
corporation.  Any unauthorized use, disclosure,	and/or reproduction of this 
software, or any part of this software; or distribution of this software in any 
form or by any means; or storage of this software in any database or retrieval 
system, without the express written consent of, and license from, SoftConnex 
Technologies, Inc. is strictly prohibited.  This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA.  All 
Rights Reserved.  Failure to abide by the use, disclosure and/or reproduction 
restrictions may result in civil and /or criminal penalties, and will be 
prosecuted to the maximum extent of	the law.
-----------------------------------------------------------------------------*/

#ifndef _SOFTCONNEX_USBLINK_H_
#define _SOFTCONNEX_USBLINK_H_

#include <linux/config.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>  /* for in_interrupt() */
#undef DEBUG
#include <linux/usb.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>

/* #define OHCI_USE_NPS		// force NoPowerSwitching mode */
/* #define OHCI_VERBOSE_DEBUG	not always helpful */

#ifdef CONFIG_PMAC_PBOOK
#include <asm/machdep.h>
#include <asm/pmac_feature.h>
#include <asm/pci-bridge.h>
#ifndef CONFIG_PM
#define CONFIG_PM
#endif
#endif

#define STATIC
#define MILLISECONDS_PER_TICK		16

#define OTG_16_BIT_DATA_BUS	1
#define OTG242_HOST_ONLY    1
#define OTG242_INTR_ACTIVE_HIGH    1
#define OTG242_NORMAL_MODE_INTR    1


#include "os_types.h"
#include "os_alloc.h"
#include "os_sema.h"
#include "os_mem.h"
#include "os_virt.h"
#include "os_alloc.h"
#include "os_intr.h"
#include "os_time.h"

#include "error.h"
#include "print.h"
#include "top.h"
#include "init.h"

extern U32 Ohci_ReadRegister(unsigned long * reg);
extern void Ohci_WriteRegister(unsigned long * reg, U32 val);
void TriggerOhciInterrupt(U32 context);


/* This two lines are os and hardware specific and should be move to os directory */
#ifdef OTG_16_BIT_DATA_BUS

U32 HW_ReadOtg242Register(volatile U8*addr, U32 offset);
void HW_WriteOtg242Register(volatile U8*addr, U32 offset, U32 val);

//#define HW_ReadOtg242Register16(addr, offset)			(U16)readw((U16 *)((U32)addr + offset))
//#define HW_WriteOtg242Register16(addr, offset, val)		writew((U16 *)((U32)addr + offset), val)

U16 HW_ReadOtg242Register16(volatile U8* addr, U32 offset);//			(U16)readw((U16 *)(addr + offset))
void HW_WriteOtg242Register16(volatile U8* addr, U32 offset, U16 val);

#else

#define HW_ReadOtg242Register(addr, offset)				readl((unsigned long *)(addr + offset))
#define HW_WriteOtg242Register(addr, offset, val)		writel((unsigned long *)(addr + offset), val)

#define HW_ReadOtg242Register16(addr, offset)			readl((unsigned long *)(addr + offset))
#define HW_WriteOtg242Register16(addr, offset, val)		writel((unsigned long *)(addr + offset), val)

#endif


#define OS_IsInISR()	((in_interrupt())?SCC_TRUE:SCC_FALSE)

#endif  /* _SOFTCONNEX_OS_USBLINK_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -