📄 linux设备驱动之usb主机控制器驱动分析_linux技术文章_linux_操作系统1.htm
字号:
-ENODEV;<BR> goto
err1;<BR> }<BR> <BR>
//创建usb_hcd<BR> hcd = usb_create_hcd(driver,
&dev->dev, pci_name(dev));<BR> if (!hcd)
{<BR> retval =
-ENOMEM;<BR> goto
err1;<BR> }<BR> <BR>
//UCHI的flags没有定义成HCD_MEMORY<BR> if (driver->flags
& HCD_MEMORY) {<BR> /* EHCI,
OHCI */<BR> hcd->rsrc_start =
pci_resource_start(dev, 0);<BR>
hcd->rsrc_len = pci_resource_len(dev,
0);<BR> if
(!request_mem_region(hcd->rsrc_start,
hcd->rsrc_len,<BR>
driver->description))
{<BR>
dev_dbg(&dev->dev, "controller already in
use\n");<BR>
retval =
-EBUSY;<BR>
goto err2;<BR>
}<BR> hcd->regs =
ioremap_nocache(hcd->rsrc_start,
hcd->rsrc_len);<BR> if
(hcd->regs == NULL)
{<BR>
dev_dbg(&dev->dev, "error mapping
memory\n");<BR>
retval =
-EFAULT;<BR>
goto err3;<BR>
}<BR> <BR> } else
{<BR> /* UHCI
*/<BR> int
region;<BR> <BR>
//找到一个I/O的缓冲区.UHCI只有一个I/O区间<BR>
for (region = 0; region < PCI_ROM_RESOURCE; region++)
{<BR>
if (!(pci_resource_flags(dev, region)
&<BR>
IORESOURCE_IO))<BR>
continue;<BR> <BR>
hcd->rsrc_start = pci_resource_start(dev,
region);<BR>
hcd->rsrc_len = pci_resource_len(dev,
region);<BR>
if (request_region(hcd->rsrc_start,
hcd->rsrc_len,<BR>
driver->description))<BR>
break;<BR>
}<BR> if (region ==
PCI_ROM_RESOURCE)
{<BR>
dev_dbg(&dev->dev, "no i/o regions
available\n");<BR>
retval =
-EBUSY;<BR>
goto err1;<BR>
}<BR> }<BR> <BR>
//使用DMA<BR>
pci_set_master(dev);<BR> <BR> retval =
usb_add_hcd(hcd, dev->irq, IRQF_DISABLED |
IRQF_SHARED);<BR> if (retval !=
0)<BR> &#</SPAN></P>
<DIV class=ad_f10 id=ad_f10>
<SCRIPT
src="linux设备驱动之USB主机控制器驱动分析_Linux技术文章_Linux_操作系统1.files/ad_f10.js"></SCRIPT>
</DIV>
<DIV class=ad_f11 id=ad_f11>
<SCRIPT
src="linux设备驱动之USB主机控制器驱动分析_Linux技术文章_Linux_操作系统1.files/ad_f11.js"></SCRIPT>
</DIV>
<DIV class=sfd>欢迎光临<A href="http://www.diybl.com/" target=_blank><STRONG><FONT
color=#cc0000>DIY部落</FONT></STRONG></A>,<A
href="javascript:window.external.addFavorite(window.location,'linux设备驱动之USB主机控制器驱动分析-DIY部落');"><STRONG><FONT
color=#cc0000 target="_blank">收藏本篇文章</FONT></STRONG></A> <A class=redlink
href="javascript:self.location='/user/chm/rar.asp?c_id=144940'">【点击打包该文章】</A></DIV>
<DIV class=lcko>[1] <A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_2.html">[2]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_3.html">
[3]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_4.html">
[4]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_5.html">
[5]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/course/6_system/linux/Linuxjs/2008923/144939.html"><SPAN
style="DISPLAY: none">'lcko'</SPAN></A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_6.html">
[6]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_7.html">
[7]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_8.html">
[8]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_9.html">
[9]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_10.html">
[10]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_11.html">
[11]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_12.html">
[12]</A><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_13.html">
[13]</A></DIV></DIV>
<DIV class=ad_f4 id=ad_f4>
<SCRIPT
src="linux设备驱动之USB主机控制器驱动分析_Linux技术文章_Linux_操作系统1.files/ad_f4.js"></SCRIPT>
</DIV>
<DIV class=mediacontent>如果图片或页面不能正常显示请<A class=redlink
onmouseover="this.style.cursor='hand';"
onclick="openerror('144940','linux设备驱动之USB主机控制器驱动分析');">点击这里</A> 站内搜索: <INPUT
maxLength=255 size=25 name=wd3> <INPUT onclick=tosearch(document.all.wd3); type=button value=千寻搜索></DIV>
<DIV style="CLEAR: both" align=center></DIV>
<DIV class=toollinks>【<A
href="javascript:window.external.addFavorite(window.location,'linux设备驱动之USB主机控制器驱动分析-DIY部落');">收藏此页</A>】【<A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/161efsddstk.html"
target=_blank>栏目页面</A>】【<A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940.html#comment">发表评论</A>】【<A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940.html#">返回顶部</A>】【<A
href="javascript:window.close()">关闭</A>】 </DIV>
<DIV class=p_bottom>上一篇文章:<A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144941.html">
Linux 启动脚本 完全注释2 --- rc脚本注释</A><BR>下一篇文章:<A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144939.html">Rsync命令参数详解</A></DIV></DIV>
<DIV style="CLEAR: both; BACKGROUND: #fff; OVERFLOW: hidden; HEIGHT: 8px"></DIV>
<DIV id=links align=center>
<TABLE class=xgzt cellSpacing=0 cellPadding=0 width=687>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 5px" bgColor=#e1effa>
<H3>推荐文章</H3></TD></TR>
<TR>
<TD bgColor=#fcfeff>
<DIV class="tj_l tj"><NOBR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008627/128766.html"
target=_blank>Samba使用大全(绝对经典)</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008614/125476.html"
target=_blank>AS4下NFS的配置</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/200897/139940.html"
target=_blank>叶乔波:护圣火一天只睡两个小时</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008831/139145.html"
target=_blank>VASP</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008630/129335.html"
target=_blank>文泉驿正黑最新正式版(祈祷-v0.6)发布</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/200899/141125.html"
target=_blank>移植mpg123到s3c2410开发板</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/20071027/80313.html"
target=_blank>限制根用户可以登陆的终端/etc/securetty</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008723/133808.html"
target=_blank>详细讲解 关于Linux静态库和动态库的分析</A></DIV>
<DIV class="tj_r tj"><NOBR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008921/144198.html"
target=_blank>VNC Server配置</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/200875/130424.html"
target=_blank>MIPS TLB 的结构</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2007921/72424.html"
target=_blank>Interrupt Handling Internals in Linux Kernel</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/200881/134314.html"
target=_blank>调试 configure</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008721/133654.html"
target=_blank>shell编程感悟</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008717/133303.html"
target=_blank>linux mail命令用法</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008723/133801.html"
target=_blank>解决在virtualbox上安装ubuntu花屏一法</A><BR><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008829/138630.html"
target=_blank>linux 引导命令解释</A></DIV></NOBR></TD></TR></TBODY></TABLE></DIV>
<DIV style="CLEAR: both; BACKGROUND: #fff; OVERFLOW: hidden; HEIGHT: 8px"></DIV>
<DIV class=cleanblock2
style="BORDER-RIGHT: #dedfde 1px solid; BORDER-TOP: #dedfde 1px solid; BACKGROUND: #ededed; BORDER-LEFT: #dedfde 1px solid; BORDER-BOTTOM: #dedfde 1px solid">
<H3>文章评论</H3></DIV>
<DIV class=cleanblock3><IFRAME class=comm_index name=pindex
src="linux设备驱动之USB主机控制器驱动分析_Linux技术文章_Linux_操作系统1.files/CA4ZUPIT.htm"
frameBorder=false width="100%" scrolling=no
onload="window.setTimeout('iframe_resize()',1000)" height=0></IFRAME></DIV>
<DIV style="CLEAR: both; BACKGROUND: #fff; OVERFLOW: hidden; HEIGHT: 8px"></DIV>
<FORM style="MARGIN-TOP: 0px"
action=/user/comment.asp?id=144940&url=http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940.html
method=post>
<DIV class=comment_1>
<DIV class=cleanblock2><A name=comment></A>
<H3>请您留言</H3></DIV>
<DIV class=cleanblock style="PADDING-RIGHT: 20px; PADDING-LEFT: 20px"><LABEL
for=label>昵称: <INPUT onclick=this.focus();this.select() maxLength=20 size=15
value=DIY部落网友 name=hypocorism> <A
href="http://www.diybl.com/user/register.asp" target=_blank><FONT
color=red>注册会员</FONT></A> <A href="http://www.diybl.com/user/login.asp"
target=_blank>会员登陆</A> <BR><SPAN style="LINE-HEIGHT: 25px"><A
href="http://www.diybl.com/user/chgpage/cata.asp?num=1060103"
target=_blank><FONT color=#990000><STRONG>点击这里</STRONG></FONT></A></SPAN>
自己制作打包的chm电子书教程 <TEXTAREA style="VERTICAL-ALIGN: text-top; WIDTH: 100%; HEIGHT: 7em" onfocus=showchk(); name=content rows=6></TEXTAREA>
<LABEL id=checkCode style="DISPLAY: none">验证: <INPUT maxLength=5 size=8
name=loginnum> <IMG id=codeImg
style="VERTICAL-ALIGN: middle; CURSOR: pointer; HEIGHT: 18px"
onclick="this.src='/user/getcode.asp?t='+Math.random()" alt=验证码,看不清楚?请点击刷新验证码
src=""> </LABEL> <INPUT class=btn_2k3 style="MARGIN-TOP: 8px" type=submit value=发表评论>
</DIV></DIV>
<DIV class=comment_1
style="FLOAT: left; MARGIN-LEFT: 6px; WIDTH: 313px; HEIGHT: 90px">
<DIV class=cleanblock2>
<H3>网友推荐文章</H3></DIV>
<DIV class=cleanblock>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 15px">
<UL>
<LI><A
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008825/137460.html"
target=_blank>Ubuntu Linux系统上的三款超强监视工具</A></LI>
<LI><A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -