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

📄 linux设备驱动之usb主机控制器驱动分析-(11)_linux技术文章_linux_操作系统11.htm

📁 linux设备驱动之USB主机控制器驱动分析
💻 HTM
📖 第 1 页 / 共 3 页
字号:
skip_to_next_interface_descriptor;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; /* 
Which interface entry is this? */<BR>&nbsp;&nbsp;&nbsp;&nbsp; intfc = 
NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp; inum = 
d-&gt;bInterfaceNumber;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//config-&gt;intf_cache保存着端点的相关信息<BR>&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; 
config-&gt;desc.bNumInterfaces; ++i) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (inums[i] == inum) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
intfc = 
config-&gt;intf_cache[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//保存的端口总数超过了最大值,非法<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (!intfc || 
intfc-&gt;num_altsetting &gt;= 
nalts[i])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; goto 
skip_to_next_interface_descriptor;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; /* 
Check for duplicate altsetting entries */<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//标识字段<BR>&nbsp;&nbsp;&nbsp;&nbsp; asnum = 
d-&gt;bAlternateSetting;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//如果存在相同的.非法<BR>&nbsp;&nbsp;&nbsp;&nbsp; for ((i = 0, alt = 
&amp;intfc-&gt;altsetting[0]);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i &lt; 
intfc-&gt;num_altsetting;<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 
(++i, ++alt)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
(alt-&gt;desc.bAlternateSetting == asnum) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
dev_warn(ddev, "Duplicate descriptor for config %d 
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; "interface %d altsetting %d, 
skipping\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; cfgno, inum, 
asnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
goto 
skip_to_next_interface_descriptor;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//更新计数<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
++intfc-&gt;num_altsetting;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//如果合法的话,那alt就是指向一个空的接点描述符<BR>&nbsp;&nbsp;&nbsp;&nbsp; memcpy(&amp;alt-&gt;desc, 
d, USB_DT_INTERFACE_SIZE);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; /* Skip over 
any Class Specific or Vendor Specific descriptors;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;* find the first endpoint or interface descriptor 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;//下一个endpoint 
descriptors的地址<BR>&nbsp;&nbsp;&nbsp;&nbsp; alt-&gt;extra = 
buffer;<BR>&nbsp;&nbsp;&nbsp;&nbsp; i = find_next_descriptor(buffer, size, 
USB_DT_ENDPOINT,<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
USB_DT_INTERFACE, &amp;n);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//alt-&gt;extar+alt-&gt;extralen表示下一个描述符地址<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
alt-&gt;extralen = i;<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (n &gt; 
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev_dbg(ddev, "skipped %d 
descriptor%s after %s\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; n, plural(n), "interface");<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//下个intreface desp的地址<BR>&nbsp;&nbsp;&nbsp;&nbsp; buffer += 
i;<BR>&nbsp;&nbsp;&nbsp;&nbsp; size -= i;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
//接口中端点描述符的个数.<FONT 
size=3>&nbsp;</FONT>注意在这里将alt-&gt;desc.bNumEndpoints清0了<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
/* Allocate space for the right(?) number of endpoints 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp; num_ep = num_ep_orig = 
alt-&gt;desc.bNumEndpoints;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
alt-&gt;desc.bNumEndpoints = 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/* Use as a counter */<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (num_ep &gt; 
USB_MAXENDPOINTS) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
dev_warn(ddev, "too many endpoints for config %d interface %d 
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
"altsetting %d: %d, using maximum allowed: 
%d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
cfgno, inum, asnum, num_ep, 
USB_MAXENDPOINTS);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; num_ep = 
USB_MAXENDPOINTS;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (num_ep &gt; 0) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Can't allocate 0 bytes 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len = sizeof(struct 
usb_host_endpoint) * 
num_ep;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;#</P>
<DIV class=ad_f10 id=ad_f10>
<SCRIPT 
src="linux设备驱动之USB主机控制器驱动分析-(11)_Linux技术文章_Linux_操作系统11.files/ad_f10.js"></SCRIPT>
</DIV>
<DIV class=ad_f11 id=ad_f11>
<SCRIPT 
src="linux设备驱动之USB主机控制器驱动分析-(11)_Linux技术文章_Linux_操作系统11.files/ad_f11.js"></SCRIPT>
</DIV>
<DIV class=kjh>欢迎光临<A href="http://www.diybl.com/" target=_blank><STRONG><FONT 
color=#cc0000>DIY部落</FONT></STRONG></A>,<A 
href="http://www.diybl.com/course/6_system/linux/Linuxjs/aca5okfsd.html" 
target=_blank><STRONG><FONT color=#cc0000>点击这里</FONT></STRONG></A>查看更多文章教程   <A 
class=redlink 
href="javascript:self.location='/user/chm/rar.asp?c_id=144940'">【点击打包该文章】</A></DIV>
<DIV class=kvl><A 
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940.html">[1]</A><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/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/course/6_system/linux/Linuxjs/2008923/144939.html"><SPAN 
style="DISPLAY: none">kvl</SPAN></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> [11] <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主机控制器驱动分析-(11)_Linux技术文章_Linux_操作系统11.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> &nbsp;&nbsp;<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/aca5okfsd.html" 
target=_blank>栏目页面</A>】【<A 
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_11.html#comment">发表评论</A>】【<A 
href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144940_11.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/2008626/128568.html" 
      target=_blank>kernel 2.6.25.8 编译升级方法</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2007104/76155.html" 
      target=_blank>可以开始预定 Ubuntu 7.10 CD了!</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008624/128136.html" 
      target=_blank>去除vim搜索后的高亮显示</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200868/123708.html" 
      target=_blank>RTC模块开发介绍</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200897/139955.html" 
      target=_blank>LINUX系统管理(2)</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008816/136160.html" 
      target=_blank>Firefox 加速技巧 [转]</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200868/123584.html" 
      target=_blank>MONO防ARP</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008923/144943.html" 
      target=_blank>Linux 启动脚本 完全注释(1) -- 整体流程</A></DIV>
      <DIV class="tj_r tj"><NOBR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2007104/76121.html" 
      target=_blank>Linux那些事儿之我是UHCI-引子</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/20071027/80131.html" 
      target=_blank>Linux vs. Windows Viruses</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200899/141144.html" 
      target=_blank>vim tips</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008612/125128.html" 
      target=_blank>Configure参数详解 </A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200873/129938.html" 
      target=_blank>HA下的oracle监控</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008619/126814.html" 
      target=_blank>Apache与Tomcat</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/2008915/142960.html" 
      target=_blank>jabber(XMPP)架设内部即时通讯服务</A><BR><A 
      href="http://www.diybl.com/course/6_system/linux/Linuxjs/200861/119405.html" 
      target=_blank>openSUSE-11.0-RC1 
出来了</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主机控制器驱动分析-(11)_Linux技术文章_Linux_操作系统11.files/CAIR81Y7.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&amp;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>&nbsp;&nbsp;&nbsp;<IMG id=codeImg 
style="VERTICAL-ALIGN: middle; CURSOR: pointer; HEIGHT: 18px" 
onclick="this.src='/user/getcode.asp?t='+Math.random()" alt=验证码,看不清楚?请点击刷新验证码 
src="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">

⌨️ 快捷键说明

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