`
javatome
  • 浏览: 820183 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Linux那些事儿 之 戏说USB(4)漫漫辛酸路

 
阅读更多

USB的一生充满了PK,并在PK中发展,1.01.12.0,漫漫辛酸路,一把辛酸泪。我们又何尝不是,上学碰到实行自费,毕业碰到IT崩溃,工作碰到房价见鬼,现在又碰到股市泡沫,与房价PK,与庄家PK,从来的结局都只有失败一个,USBPK中发展,我们在PK中只有变老。

<shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></path><lock v:ext="edit" aspectratio="t"></lock></shapetype><shape id="_x0000_i1025" style="WIDTH: 335.25pt; HEIGHT: 298.5pt" type="#_x0000_t75"><imagedata src="file:///C:/DOCUME~1/baihehua/LOCALS~1/Temp/msohtml1/01/clip_image001.emz" o:title=""></imagedata></shape>

这张表是从USB2.0 spec里直接拿过来的,可以看出,它的高速模式最高已经达到了480Mbps,即60MBps,这是个什么概念,也就是说,照这个速度,你将自己从网上下的小短片备份到自己的移动硬盘上不用一秒钟,而按照USB1.1最高12Mbps的速度,你需要将近1分钟。2.01.1的最高速度足足提高了几十倍,日后任小强们说房价还很合理,增加不多的时候可以不用和美国比和日本比了,和USB传输速度的发展比好了,更加能够显示房价的低廉。USB走过的这段辛酸路,对咱们来说最直观的结果也就是传输速度提高了,过程很艰辛,结果很简单,是不。

USB的各个版本是兼容的。每个USB2.0 控制器带有3个芯片,根据设备的识别方式将信号发送到正确的控制芯片。我们可以将1.1设备连接到2.0的控制器上使用,不过它只能达到1.1的速度。同时也可以将2.0的设备连接到1.1的控制器上,不过不能指望它能以2.0的速度运行。毕竟走过的路太辛酸了,没有那么快就忘掉,好像我们不时的要去交大门口的老赵烤肉店忆苦思甜一样,我们不能忘本,USB也不能。

显然,LinuxUSB1.12.0都是支持的,通过看drivers/usb/host目录下的Kconfig文件,我们可以知道内核里支持的控制器。

25 config USB_EHCI_HCD
26 tristate "EHCI HCD (USB 2.0) support"
27 depends on USB && PCI
28 ---help---
29 The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
30 "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
31 If your USB host controller supports USB 2.0, you will likely want to
32 configure this Host Controller Driver.At this writing, the primary
33 implementation of EHCI is a chip from NEC, widely available in add-on
34 PCI cards, but implementations are in the works from other vendors
35 including Intel and Philips.Motherboard support is appearing.
37 EHCI controllers are packaged with "companion" host controllers (OHCI
38 or UHCI) to handle USB 1.1 devices connected to root hub ports.Ports
39 will connect to EHCI if it the device is high speed, otherwise they
40 connect to a companion controller.If you configure EHCI, you should
41 probably configure the OHCI (for NEC and some other vendors) USB Host
42 Controller Driver or UHCI (for Via motherboards) Host Controller
43 Driver too.
45 You may want to read <file:Documentation/usb/ehci.txt>.
47 To compile this driver as a module, choose M here: the
48 module will be called ehci-hcd.

这里使用的都是<chsdate isrocdate="False" islunardate="False" day="30" month="12" year="1899" w:st="on"><span lang="EN-US" style="FONT-FAMILY: Verdana">2.6.11</span></chsdate>版本内核的。所有与USB相关的代码都在drivers/usb目录下面。上面的Kconfig文件说的很清楚,ehci-hcd模块支持的是USB2.0控制器的高速模式,它本身并不支持全速或低速模式,对连接上的USB1.1设备的支持,是通过ohci-hcduhci-hcd模块。如果我们只配置了EHCI,就不能使用usb的鼠标键盘。有时碰到usb键盘或鼠标不能用的情况,很可能就是因为配置EHCI的同时没有配置OHCIUHCI。多少年以前我还是个青涩少年的时候就遇到过这个问题。

70 config USB_OHCI_HCD
71 tristate "OHCI HCD support"
72 depends on USB && USB_ARCH_HAS_OHCI
73 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
74 ---help---
75 The Open Host Controller Interface (OHCI) is a standard for accessing
76 USB 1.1 host controller hardware. It does more in hardware than Intel's
77 UHCI specification. If your USB host controller follows the OHCI spec,
78 say Y. On most non-x86 systems, and on x86 hardware that's not using a
79 USB controller from Intel or VIA, this is appropriate. If your host
80 controller doesn't use PCI, this is probably appropriate. For a PCI
81 based system where you're not sure, the "lspci -v" entry will list the
82 right "prog-if" for your USB controller(s): EHCI, OHCI, or UHCI.
83
84 To compile this driver as a module, choose M here: the
85 module will be called ohci-hcd.
86
87 config USB_UHCI_HCD
88 tristate "UHCI HCD (most Intel and VIA) support"
89 depends on USB && PCI
90 ---help---
91 The Universal Host Controller Interface is a standard by Intel for
92 accessing the USB hardware in the PC (which is also called the USB
93 host controller). If your USB host controller conforms to this
94 standard, you may want to say Y, but see below. All recent boards
95 with Intel PCI chipsets (like intel 430TX, 440FX, 440LX, 440BX,
96 i810, i820) conform to this standard. Also all VIA PCI chipsets
97 (like VIA VP2, VP3, MVP3, Apollo Pro, Apollo Pro II or Apollo Pro
98 133). If unsure, say Y.
99
100 To compile this driver as a module, choose M here: the
101 module will be called uhci-hcd.

OHCIUHCI虽然支持的都是1.1的控制器,但是支持的硬件范围不一样,房子、股票我们需要关心的太多了,就不用去管它们了,如果你在编译内核,直接选上它们就是了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics