📄 linux设备驱动之usb主机控制器驱动分析-(11)_linux技术文章_linux_操作系统11.htm
字号:
skip_to_next_interface_descriptor;<BR> <BR> /*
Which interface entry is this? */<BR> intfc =
NULL;<BR> inum =
d->bInterfaceNumber;<BR>
//config->intf_cache保存着端点的相关信息<BR> for (i = 0; i <
config->desc.bNumInterfaces; ++i)
{<BR> if (inums[i] == inum)
{<BR>
intfc =
config->intf_cache[i];<BR>
break;<BR>
}<BR> }<BR>
//保存的端口总数超过了最大值,非法<BR> if (!intfc ||
intfc->num_altsetting >=
nalts[i])<BR> goto
skip_to_next_interface_descriptor;<BR> <BR> /*
Check for duplicate altsetting entries */<BR>
//标识字段<BR> asnum =
d->bAlternateSetting;<BR>
//如果存在相同的.非法<BR> for ((i = 0, alt =
&intfc->altsetting[0]);<BR>
i <
intfc->num_altsetting;<BR>
(++i, ++alt)) {<BR> if
(alt->desc.bAlternateSetting == asnum)
{<BR>
dev_warn(ddev, "Duplicate descriptor for config %d
"<BR>
"interface %d altsetting %d,
skipping\n",<BR>
cfgno, inum,
asnum);<BR>
goto
skip_to_next_interface_descriptor;<BR>
}<BR> }<BR> <BR>
//更新计数<BR>
++intfc->num_altsetting;<BR>
//如果合法的话,那alt就是指向一个空的接点描述符<BR> memcpy(&alt->desc,
d, USB_DT_INTERFACE_SIZE);<BR> <BR> /* Skip over
any Class Specific or Vendor Specific descriptors;<BR>
* find the first endpoint or interface descriptor
*/<BR> //下一个endpoint
descriptors的地址<BR> alt->extra =
buffer;<BR> i = find_next_descriptor(buffer, size,
USB_DT_ENDPOINT,<BR>
USB_DT_INTERFACE, &n);<BR>
//alt->extar+alt->extralen表示下一个描述符地址<BR>
alt->extralen = i;<BR> if (n >
0)<BR> dev_dbg(ddev, "skipped %d
descriptor%s after %s\n",<BR>
n, plural(n), "interface");<BR>
//下个intreface desp的地址<BR> buffer +=
i;<BR> size -= i;<BR> <BR>
//接口中端点描述符的个数.<FONT
size=3> </FONT>注意在这里将alt->desc.bNumEndpoints清0了<BR>
/* Allocate space for the right(?) number of endpoints
*/<BR> num_ep = num_ep_orig =
alt->desc.bNumEndpoints;<BR>
alt->desc.bNumEndpoints = 0;
/* Use as a counter */<BR> if (num_ep >
USB_MAXENDPOINTS) {<BR>
dev_warn(ddev, "too many endpoints for config %d interface %d
"<BR>
"altsetting %d: %d, using maximum allowed:
%d\n",<BR>
cfgno, inum, asnum, num_ep,
USB_MAXENDPOINTS);<BR> num_ep =
USB_MAXENDPOINTS;<BR>
}<BR> <BR> if (num_ep > 0)
{<BR> /* Can't allocate 0 bytes
*/<BR> len = sizeof(struct
usb_host_endpoint) *
num_ep;<BR> &#</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> <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&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">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -