← Documents Documentation/usb/acm.rst GitHub 원문 ↗

Linux 6.18.37 · USB

Linux ACM driver v0.16

USB CDC ACM modem/ISDN 장치의 지원 조건, module 구성, debugfs descriptor 판별, system log와 AT command 시험을 설명합니다.

Source pathDocumentation/usb/acm.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

acm.rst:1-132

`cdc-acm.ko`는 USB CDC ACM specification을 따르는 modem, ISDN terminal adapter, 일부 휴대전화를 tty device로 제공합니다. 동작 확인의 핵심은 debugfs에서 communication/data class와 `Driver=acm` binding을 찾고, `ttyACM`에 `at` command를 보내 `OK` 응답을 확인하는 것입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ======================
2 Linux ACM driver v0.16
3 ======================
4
5 Copyright (c) 1999 Vojtech Pavlik <[email protected]>
6
7 Sponsored by SuSE
8
9 0. Disclaimer
10 ~~~~~~~~~~~~~
11 This program is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the Free
13 Software Foundation; either version 2 of the License, or (at your option)
14 any later version.
15
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 more details.
20
21 You should have received a copy of the GNU General Public License along
22 with this program; if not, write to the Free Software Foundation, Inc., 59
23 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
25 Should you need to contact me, the author, you can do so either by e-mail -
26 mail your message to <[email protected]>, or by paper mail: Vojtech Pavlik,
27 Ucitelska 1576, Prague 8, 182 00 Czech Republic
28
29 For your convenience, the GNU General Public License version 2 is included
30 in the package: See the file COPYING.
31
32 1. Usage
33 ~~~~~~~~
34 The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
35 adapters that conform to the Universal Serial Bus Communication Device Class
36 Abstract Control Model (USB CDC ACM) specification.
37
38 Many modems do, here is a list of those I know of:
39
40 - 3Com OfficeConnect 56k
41 - 3Com Voice FaxModem Pro
42 - 3Com Sportster
43 - MultiTech MultiModem 56k
44 - Zoom 2986L FaxModem
45 - Compaq 56k FaxModem
46 - ELSA Microlink 56k
47
48 I know of one ISDN TA that does work with the acm driver:
49
50 - 3Com USR ISDN Pro TA
51
52 Some cell phones also connect via USB. I know the following phones work:
53
54 - SonyEricsson K800i
55
56 Unfortunately many modems and most ISDN TAs use proprietary interfaces and
57 thus won't work with this drivers. Check for ACM compliance before buying.
58
59 To use the modems you need these modules loaded::
60
61 usbcore.ko
62 uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
63 cdc-acm.ko
64
65 After that, the modem[s] should be accessible. You should be able to use
66 minicom, ppp and mgetty with them.
67
68 2. Verifying that it works
69 ~~~~~~~~~~~~~~~~~~~~~~~~~~
70
71 The first step would be to check /sys/kernel/debug/usb/devices, it should look
72 like this::
73
74 T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
75 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
76 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
77 P: Vendor=0000 ProdID=0000 Rev= 0.00
78 S: Product=USB UHCI Root Hub
79 S: SerialNumber=6800
80 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
81 I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
82 E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
83 T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
84 D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
85 P: Vendor=04c1 ProdID=008f Rev= 2.07
86 S: Manufacturer=3Com Inc.
87 S: Product=3Com U.S. Robotics Pro ISDN TA
88 S: SerialNumber=UFT53A49BVT7
89 C: #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 0mA
90 I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm
91 E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
92 E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
93 E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
94 C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr= 0mA
95 I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
96 E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
97 I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
98 E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
99 E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
100
101 The presence of these three lines (and the Cls= 'comm' and 'data' classes)
102 is important, it means it's an ACM device. The Driver=acm means the acm
103 driver is used for the device. If you see only Cls=ff(vend.) then you're out
104 of luck, you have a device with vendor specific-interface::
105
106 D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
107 I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
108 I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
109
110 In the system log you should see::
111
112 usb.c: USB new device connect, assigned device number 2
113 usb.c: kmalloc IF c7691fa0, numif 1
114 usb.c: kmalloc IF c7b5f3e0, numif 2
115 usb.c: skipped 4 class/vendor specific interface descriptors
116 usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
117 usb.c: USB device number 2 default language ID 0x409
118 Manufacturer: 3Com Inc.
119 Product: 3Com U.S. Robotics Pro ISDN TA
120 SerialNumber: UFT53A49BVT7
121 acm.c: probing config 1
122 acm.c: probing config 2
123 ttyACM0: USB ACM device
124 acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0
125 acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7
126 usb.c: acm driver claimed interface c7b5f3e0
127 usb.c: acm driver claimed interface c7b5f3f8
128 usb.c: acm driver claimed interface c7691fa0
129
130 If all this seems to be OK, fire up minicom and set it to talk to the ttyACM
131 device and try typing 'at'. If it responds with 'OK', then everything is
132 working.
133

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

제목, 저작권, 후원

1-8

이 문서는 Linux ACM driver v0.16을 설명합니다.

Copyright는 1999년 Vojtech Pavlik `<[email protected]>`에게 있으며 SuSE가 후원했습니다.

======================
Linux ACM driver v0.16
======================

Copyright (c) 1999 Vojtech Pavlik <[email protected]>

Sponsored by SuSE

GPL 면책과 연락처

9-31

이 program은 free software이며 Free Software Foundation이 발표한 GNU General Public License version 2 또는 사용자가 선택한 그 이후 version의 조건에 따라 재배포하거나 수정할 수 있습니다.

이 program은 유용하기를 바라며 배포되지만 상품성이나 특정 목적 적합성에 대한 묵시적 보증을 포함해 어떠한 보증도 제공하지 않습니다. 자세한 내용은 GNU General Public License를 확인해야 합니다.

Program과 함께 GNU GPL 사본을 받았어야 하며, 받지 못했다면 원문에 적힌 Free Software Foundation의 Boston 주소로 문의합니다.

저자에게는 `<[email protected]>`로 email을 보내거나 원문에 적힌 Prague의 우편 주소로 연락할 수 있습니다.

편의를 위해 GNU GPL version 2가 package의 `COPYING` file에 포함되어 있습니다.

0. Disclaimer
~~~~~~~~~~~~~
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA

Should you need to contact me, the author, you can do so either by e-mail -
mail your message to <[email protected]>, or by paper mail: Vojtech Pavlik,
Ucitelska 1576, Prague 8, 182 00 Czech Republic

For your convenience, the GNU General Public License version 2 is included
in the package: See the file COPYING.

USB CDC ACM 적용 범위

32-37

`drivers/usb/class/cdc-acm.c` driver는 Universal Serial Bus Communication Device Class Abstract Control Model, 즉 USB CDC ACM specification을 따르는 USB modem과 USB ISDN terminal adapter를 지원합니다.

1. Usage
~~~~~~~~
The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
adapters that conform to the Universal Serial Bus Communication Device Class
Abstract Control Model (USB CDC ACM) specification.

알려진 지원 장치

38-58

원문이 확인한 지원 modem은 3Com OfficeConnect 56k, 3Com Voice FaxModem Pro, 3Com Sportster, MultiTech MultiModem 56k, Zoom 2986L FaxModem, Compaq 56k FaxModem, ELSA Microlink 56k입니다.

지원이 확인된 ISDN terminal adapter는 3Com USR ISDN Pro TA이고, USB 연결 휴대전화 예는 SonyEricsson K800i입니다.

많은 modem과 대부분의 ISDN TA는 proprietary interface를 사용하므로 이 driver로 동작하지 않습니다. 구매 전에 ACM compliance를 확인해야 합니다.

ACM driver 지원 확인 장치
종류장치
Modem3Com OfficeConnect 56k
Modem3Com Voice FaxModem Pro
Modem3Com Sportster
ModemMultiTech MultiModem 56k
ModemZoom 2986L FaxModem
ModemCompaq 56k FaxModem
ModemELSA Microlink 56k
ISDN TA3Com USR ISDN Pro TA
휴대전화SonyEricsson K800i

문서가 동작을 확인했다고 열거한 장치를 종류별로 정리합니다.

Many modems do, here is a list of those I know of:

	- 3Com OfficeConnect 56k
	- 3Com Voice FaxModem Pro
	- 3Com Sportster
	- MultiTech MultiModem 56k
	- Zoom 2986L FaxModem
	- Compaq 56k FaxModem
	- ELSA Microlink 56k

I know of one ISDN TA that does work with the acm driver:

	- 3Com USR ISDN Pro TA

Some cell phones also connect via USB. I know the following phones work:

	- SonyEricsson K800i

Unfortunately many modems and most ISDN TAs use proprietary interfaces and
thus won't work with this drivers. Check for ACM compliance before buying.

필수 module과 userspace 도구

59-67

Modem을 사용하려면 `usbcore.ko`, host controller에 맞는 `uhci-hcd.ko`·`ohci-hcd.ko`·`ehci-hcd.ko` 중 하나, 그리고 `cdc-acm.ko`를 load해야 합니다.

usbcore.ko
uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
cdc-acm.ko

Module이 load된 뒤 modem에 접근할 수 있어야 하며 `minicom`, `ppp`, `mgetty`를 사용할 수 있습니다.

To use the modems you need these modules loaded::

	usbcore.ko
	uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
	cdc-acm.ko

After that, the modem[s] should be accessible. You should be able to use
minicom, ppp and mgetty with them.

USB device descriptor 확인

68-100

첫 단계는 `/sys/kernel/debug/usb/devices`를 확인하는 것입니다. 원문의 예는 UHCI root hub와 3Com U.S. Robotics Pro ISDN TA의 topology, device descriptor, configuration, interface, endpoint를 보여 줍니다.

예에서 configuration 1은 vendor-specific interface에 `Driver=acm`을 표시하고, 선택된 configuration 2는 communication interface와 data interface를 각각 `Driver=acm`에 연결합니다. Bulk IN/OUT endpoint와 interrupt IN endpoint도 함께 나타납니다.

이 block은 진단 출력을 그대로 보존해야 하므로 symbol, field, hexadecimal value, endpoint 방향을 번역하지 않습니다.

2. Verifying that it works
~~~~~~~~~~~~~~~~~~~~~~~~~~

The first step would be to check /sys/kernel/debug/usb/devices, it should look
like this::

  T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
  B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
  D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
  P:  Vendor=0000 ProdID=0000 Rev= 0.00
  S:  Product=USB UHCI Root Hub
  S:  SerialNumber=6800
  C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
  I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
  E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
  T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
  D:  Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  2
  P:  Vendor=04c1 ProdID=008f Rev= 2.07
  S:  Manufacturer=3Com Inc.
  S:  Product=3Com U.S. Robotics Pro ISDN TA
  S:  SerialNumber=UFT53A49BVT7
  C:  #Ifs= 1 Cfg#= 1 Atr=60 MxPwr=  0mA
  I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm
  E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
  E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
  E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms
  C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr=  0mA
  I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
  E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms
  I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
  E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
  E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms

ACM class 판별 조건

101-109

ACM device 여부를 판별할 때 `Cls=02(comm.)` device line, `Cls=02(comm.) Sub=02 Prot=01 Driver=acm` control interface, `Cls=0a(data ) Sub=00 Prot=00 Driver=acm` data interface의 세 줄이 중요합니다.

`comm.`과 `data` class가 있고 `Driver=acm`이면 ACM driver가 device를 사용 중이라는 뜻입니다. `Cls=ff(vend.)`만 보인다면 vendor-specific interface이므로 표준 ACM device로 사용할 수 없습니다.

ACM descriptor signature
범위필수 표식의미
DeviceCls=02(comm.)Communication device class
Control interfaceCls=02(comm.) Sub=02 Prot=01 Driver=acmACM control interface
Data interfaceCls=0a(data ) Sub=00 Prot=00 Driver=acmACM data interface
Vendor-onlyCls=ff(vend.)표준 ACM으로 사용할 수 없음

Debugfs 출력에서 확인할 class와 driver field입니다.

The presence of these three lines (and the Cls= 'comm' and 'data' classes)
is important, it means it's an ACM device. The Driver=acm means the acm
driver is used for the device. If you see only Cls=ff(vend.) then you're out
of luck, you have a device with vendor specific-interface::

  D:  Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  2
  I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
  I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm

System log에서 binding 확인

110-129

System log에는 새 USB device 번호 할당, interface allocation, class/vendor-specific descriptor 처리, manufacturer·product·serial string, 두 configuration probe가 차례로 나타나야 합니다.

`ttyACM0: USB ACM device`는 tty device가 생성되었음을 뜻합니다. 이어지는 `acm_control_msg` 결과와 여러 `acm driver claimed interface` line은 driver가 필요한 interface를 claim했음을 보여 줍니다.

주소와 message 형식은 역사적 log 예시이므로 그대로 보존합니다.

In the system log you should see::

  usb.c: USB new device connect, assigned device number 2
  usb.c: kmalloc IF c7691fa0, numif 1
  usb.c: kmalloc IF c7b5f3e0, numif 2
  usb.c: skipped 4 class/vendor specific interface descriptors
  usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
  usb.c: USB device number 2 default language ID 0x409
  Manufacturer: 3Com Inc.
  Product: 3Com U.S. Robotics Pro ISDN TA
  SerialNumber: UFT53A49BVT7
  acm.c: probing config 1
  acm.c: probing config 2
  ttyACM0: USB ACM device
  acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0
  acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7
  usb.c: acm driver claimed interface c7b5f3e0
  usb.c: acm driver claimed interface c7b5f3f8
  usb.c: acm driver claimed interface c7691fa0

AT command로 최종 시험

130-132

앞선 상태가 모두 정상이라면 `minicom`을 실행해 `ttyACM` device와 통신하도록 설정합니다. `at`를 입력했을 때 `OK`가 돌아오면 모든 기능이 동작하는 것입니다.

If all this seems to be OK, fire up minicom and set it to talk to the ttyACM
device and try typing 'at'. If it responds with 'OK', then everything is
working.