요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
======================
Linux ACM driver v0.16
======================
Copyright (c) 1999 Vojtech Pavlik <[email protected]>
Sponsored by SuSE
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.
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.
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.
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.
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
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
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
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.
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를 확인해야 합니다.
문서가 동작을 확인했다고 열거한 장치를 종류별로 정리합니다.
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-67Modem을 사용하려면 `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-109ACM 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로 사용할 수 없습니다.
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-129System 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.
요약·해설
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` 응답을 확인하는 것입니다.