/**
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 2001. Samsung Electronics, co. ltd All rights reserved.
Module Name:
Abstract:
S3C2410 USB function(ACTIVE SYNC) device driver (Chip Layer)
rev:
2003.3.18 : EP3 is replaced by EP4 for DMA operation because DMA2(EP3) is used by audio. (purnnamu)
2003.3.17 : Every USBD interrupt is followed by the dummy interrupt
because USBD sub-pending interrupt is cleared after clearing INTPND register.
So,USBD sub-pending bit is cleared before clearing INTPND register. (purnnamu)
2002.5.7 : Add to s3c2410_code (Seung-han, Lim)
2002.1.22 : First release/no error recovery (kwangyoon LEE, kwangyoon@samsung.com)
Notes:
*/
/* MiTAC Int'l Corp. 2002
$release notes
Modifier sign date Description
================================================================================
DicK dic100 11/04/2005 Remove debug message
Jonathan Jonatahn01_0915 09/15/2005 Modify S2440 USB Driver to PNA500
Jonathan Jonathan02_1007 10/07/2005 Modify max power : 50mA change to 450mA
*/
#include <windows.h>
#include <types.h>
#include <ceddk.h>
#include <memory.h>
#include <serhw.h>
#include <nkintr.h>
#include "S2410.h"
#include <SC2410_usb_hw.h>
#include <SC2410_usb_ser.h>
#undef ZONE_INIT
#include <serdbg.h>
#include <drv_glob.h> //:-)
#include <2410usb.h> //:-)
#define USBDMSG DEBUGMSG //RETAILMSG
PDRIVER_GLOBALS v_pDriverGlobals=NULL; //:-)
volatile USBD_GLOBALS *usbdShMem=NULL; //:-)
volatile DMAreg *v_pDMAregs=NULL; //:-)
volatile INTreg *v_pINTregs=NULL; //:-)
extern volatile IOPreg *s2410IOP; //Jonatahan01_0915
extern volatile PDRIVER_GLOBALS pDriverGlobals; //Jonatahan01_0915
ULONG realPhysicalAddr_UsbdRxBuf=0;
ULONG totalRxCnt=0; //debug
BOOL bWritefull=FALSE;//Jason0315
/*
#if (USBD_GLOBALS_BUF_SIZE!=0x4000)
STOP_COMPILE GEN_ERROR
//drv_glob.h should be changed correctly
#endif
*/
// This driver defines a simple BULK FIFO device. It supports only one
// interface with one alternate setting, as shown below.
//
// Endpoint Setting 0
//------------------------
// EP0 Control
// EP1 In Bulk
// EP3 Out Bulk
// Steal the useless IR zone from MDD and use it as EP0 & USB specific stuff
#define ZONE_USB ZONE_IR
// Define the configuration descriptor length
#define CFGLEN 32
#define iCONF 18
#define TLEN (CFGLEN + 18)
// Define the configuration descriptor itself
const BYTE uStd[TLEN]= {
0x12, // 0 desc size
DEVICE, // 1 desc type (DEVICE)
0x00, // 2 USB release
0x01, // 3 => 1.00
0xff, // 4 class
0xff, // 5 subclass
0xff, // 6 protocol
EP0_MAXP_SIZE, // 7 max pack size
/*
0x47, // 8 vendor ID LSB (Samsung Semi)
0x05, // 9 vendor ID MSB ( 0x1419 )
0x20, // 10 product ID LSB
0x27, // 11 product ID MSB
*/
idVendorH, idVendorL, // idVendor
idProductH, idProductL, // idProduct
0x00, // 12 device release LSB
0x00, // 13 device release MSB
0x00, // 14 manufacturer string desc index
0x00, // 15 product string desc index
0x00, // 16 serial num string desc index
0x01, // 17 num of possible configurations
// Configuration Descriptor
0x09, // desc size
CONFIGURATION, // desc type (CONFIGURATION)
CFGLEN%256, // total length of data returned LSB
CFGLEN/256, // total length of data returned MSB
0x01, // num of interfaces
0x01, // value to select config (1 for now)
0x00, // index of string desc ( 0 for now)
0x80, // bus powered
//Jonathan02_1007 25, // max power, 50mA for now
225, // max power, 450mA for PNA500/PNA510 //Jonathan02_1007
// Interface Decriptor
0x09, // desc size
INTERFACE, // desc type (INTERFACE)
0x00, // interface index.
0x00, // value for alternate setting
0x02, // bNumEndpoints (number endpoints used, excluding EP0)
0xff,
0xff,
0xff,
0x00, // string index,
// Endpoint descriptor (EP 1 Bulk IN)
0x07, // desc size
ENDPOINT, // desc type (ENDPOINT)
0x81, // endpoint address: endpoint 1, IN
0x02, // endpoint attributes: Bulk
EP1_IN_MAXP_SIZE, // max packet size LSB
0x00, // max packet size MSB
0x00, // polling interval (4ms/bit=time,500ms)
#if 0
// Endpoint descriptor (EP 2 Interrupt IN)
0x07, // desc size
ENDPOINT, // desc type (ENDPOINT)
0x82, // endpoint address: endpoint 2, IN
0x03, // endpoint attributes: Interrupt
EP2_IN_MAXP_SIZE, // max packet size LSB
0x00, // max packet size MSB
0xFA, // polling interval (4ms/bit=time,100ms)
#endif
// Endpoint descriptor (EP 4 Bulk OUT)
0x07, // desc size
ENDPOINT, // desc type (ENDPOINT)
0x04, // endpoint address: endpoint 4, OUT
0x02, // endpoint attributes: Bulk
EP4_OUT_MAXP_SIZE, // max packet size LSB
0x00, // max packet size MSB
0x00 // polling interval (4ms/bit=time,500ms)
#if 0
// Endpoint descriptor (EP 4 Interrupt OUT)
0x07, // desc size
ENDPOINT, // desc type (ENDPOINT)
0x04, // endpoint address: endpoint 4, OUT
0x03, // endpoint attributes: Interrupt
EP4_OUT_MAXP_SIZE, // max packet size LSB
0x00, // max packet size MSB
0x00 // polling interval (4ms/bit=time,500ms) // $$$$
#endif
};
// Register writes need to be verified. This macro loops the write until
// the effects are visible and records the number of retries.
#define UDC_REG_WRITE(_struct,_ptr,_field,_val) IOW_REG_FIELD(_struct,_ptr,_field,_val)
#define UDC_REG_BITSET(_struct,_ptr,_field,_val) { _struct xx; \
*(unsigned int *)&xx = 0; \
xx._field = _val; \
IOW_REG_SET(_struct,_ptr,*(unsigned int*)&xx); }
#define UDC_REG_WRITEX(_setptr,_setval) (_setptr) = _setval;
// Variables for EP0 resend control. Keep track of last packet sent.
static char *sendPacket;
static int sendPacketLength;
static int sendTotalLength;
static char *savSendPacket;
static int savSendPacketLength;
// EP1/EP3 packet size. For polling this can not be greater than 16
static unsigned int maxPacketSize = EP1Len;
// Read the command from the endpoint 0 FIFO
void HW_USBClocks(PSER_INFO pHWHead);
static
int getCommand(PSER_INFO pHWHead, void *argP)
{
unsigned char *bufP = (unsigned char*)argP;
int length = pHWHead->pUSBCtrlAddr->OFCR1.out_cnt_low | pHWHead->pUSBCtrlAddr->OFCR2.out_cnt_high<<8;
int i;
memset(bufP, 0x55, 8);
// All setup commands are 8 bytes in length
if (length != 8)
{
DEBUGMSG(1, (TEXT("UDC bad command l
没有合适的资源?快使用搜索试试~ 我知道了~
function_1.rar_2410 USB驱动_2410 usb_USB驱动
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共7个文件
h:2个
c:2个
sources:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 96 浏览量
2022-09-23
23:19:42
上传
评论
收藏 31KB RAR 举报
温馨提示
三星公司2410的usb驱动程序,适合于ads1.2版本。
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![patch](https://img-home.csdnimg.cn/images/20210720083646.png)
![pack](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
共 7 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/c7605ebd585249f1b630f560f4d9ba6f_weixin_42650811.jpg!1)
我虽横行却不霸道
- 粉丝: 77
- 资源: 1万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)