This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:lte [2017/11/20 13:08] 1.241.172.144 [User space] |
wiki:lte [2017/11/20 14:32] (current) 1.241.172.144 [User space] |
||
---|---|---|---|
Line 76: | Line 76: | ||
a new ’qmi_wwan’ driver, simpler in orders of magnitude and much easier to maintain, while leaving all the | a new ’qmi_wwan’ driver, simpler in orders of magnitude and much easier to maintain, while leaving all the | ||
complex logic to user-space processes, which are usually more flexible and where it is easier to change behavior | complex logic to user-space processes, which are usually more flexible and where it is easier to change behavior | ||
- | or fix errors. This new driver has been available since Linux 3.4. | + | or fix errors. This new driver has been available since Linux 3.4.\\ |
+ | 이 문제를 해결하기 위해 업스트림 커널 개발자는 전혀 다른 접근 방식을 취해 새로운 qmi_wwan 드라이버를 개발했습니다. 이 드라이버는 모든 복잡한 논리를 사용자 공간 프로세스로 남기면서 크기가 더 간단하고 유지 보수가 훨씬 간단합니다. 보통보다 유연하고 행동을 바꾸거나 오류를 수정하는 것이 더 쉽습니다. 이 새로운 드라이버는 Linux 3.4부터 사용할 수 있습니다. | ||
This conflict between kernel drivers is uncommon because of how the QMI protocol is defined. It’s harder to | This conflict between kernel drivers is uncommon because of how the QMI protocol is defined. It’s harder to | ||
draw the line between what should be kernel or user space based tasks. The following sections try to detail | draw the line between what should be kernel or user space based tasks. The following sections try to detail | ||
- | where that line was drawn in both approaches. | + | where that line was drawn in both approaches.\\ |
+ | 커널 드라이버 간의 이러한 충돌은 QMI 프로토콜이 정의 된 방식 때문에 드문 경우입니다. 커널 또는 사용자 공간 기반 작업 사이에 선을 그리는 것이 어렵습니다. 다음 섹션에서는 두 가지 방법 모두에서 그 행이 그려진 곳을 자세히 설명하려고합니다. | ||
===qmi wwan=== | ===qmi wwan=== | ||
- | Since Linux 3.4, the qmi wwan driver has been available in the upstream Linux releases. Being a driver maintained | + | Since Linux 3.4, the qmi wwan driver has been available in the upstream Linux releases. Being a driver maintained within the upstream tree means that none of the problems exposed for GobiNet are applicable, so:\\ |
- | within the upstream tree means that none of the problems exposed for GobiNet are applicable, so: | + | Linux 3.4부터 qmi wwan 드라이버는 업스트림 Linux 릴리스에서 사용할 수 있습니다. 업스트림 트리 내에서 드라이버를 유지한다는 것은 GobiNet에 노출 된 문제가 전혀 적용되지 않는다는 것을 의미합니다. |
• Users will get the driver already available for the exact kernel they are using.\\ | • Users will get the driver already available for the exact kernel they are using.\\ | ||
Line 109: | Line 111: | ||
QMI over USB basically uses CDC-WDM messages for the transport, and since the kernel already has code for | QMI over USB basically uses CDC-WDM messages for the transport, and since the kernel already has code for | ||
that, the qmi wwan driver fully relies on the generic cdc-wdm driver to manage the CONTROL and INTERRUPT | that, the qmi wwan driver fully relies on the generic cdc-wdm driver to manage the CONTROL and INTERRUPT | ||
- | endpoints. | + | endpoints.\\ |
+ | USB를 통한 QMI는 CDC-WDM 메시지를 전송에 기본적으로 사용하며, 커널에 이미 코드가 있으므로 qmi wwan 드라이버는 CONTROL 및 INTERRUPT 끝점을 관리하기 위해 일반 cdc-wdm 드라이버를 전적으로 사용합니다. | ||
This is possible because, as explained earlier, the USB communication is done using SendEncapsulatedCommand | This is possible because, as explained earlier, the USB communication is done using SendEncapsulatedCommand | ||
and GetEncapsulatedResponse requests as defined by the CDC USB class. The cdc-wdm driver supports the | and GetEncapsulatedResponse requests as defined by the CDC USB class. The cdc-wdm driver supports the | ||
- | WMC Device Management functionality of cell phones compliant to the CDC WMC specification15. The result | + | WMC Device Management functionality of cell phones compliant to the CDC WMC specification. The result |
of using the cdc-wdm as a subdriver in qmi wwan is that a new /dev/cdc-wdmX character device is exposed | of using the cdc-wdm as a subdriver in qmi wwan is that a new /dev/cdc-wdmX character device is exposed | ||
- | for user-space use, which allows exchanging QMI messages. | + | for user-space use, which allows exchanging QMI messages.\\ |
+ | 앞에서 설명한 것처럼 USB 통신은 CDC USB 클래스에 정의 된대로 SendEncapsulatedCommand 및 GetEncapsulatedResponse 요청을 사용하여 수행되기 때문에 가능합니다. cdc-wdm 드라이버는 CDC WMC 사양을 준수하는 휴대폰의 WMC 장치 관리 기능을 지원합니다. qmi wwan의 서브 드라이브로 cdc-wdm을 사용하면 새로운 /dev/cdc-wdmX 문자 장치가 사용자 공간 사용에 노출되어 QMI 메시지를 교환 할 수 있습니다. | ||
- | As with the GobiNet case, qmi wwan also exposes a network interface, named as wwanX because the driver | + | qmi wwan also exposes a network interface, named as wwanX because the driver gets explicitly registered with the FLAG WWAN flag. |
- | gets explicitly registered with the FLAG WWAN flag. | + | qmi wwan은 드라이버가 FLAG WWAN 플래그로 명시 적으로 등록되기 때문에 wwanX라는 네트워크 인터페이스도 제공합니다. |
==The CTL service== | ==The CTL service== | ||
Line 126: | Line 130: | ||
hard work to user-space doesn’t come without any cost. In particular, relaying to user-space the management | hard work to user-space doesn’t come without any cost. In particular, relaying to user-space the management | ||
of the actions performed by the CTL service means that only one single process will be able to successfully use | of the actions performed by the CTL service means that only one single process will be able to successfully use | ||
- | the /dev/cdc-wdmX character device. | + | the /dev/cdc-wdmX character device.\\ |
+ | qmi wwan 드라이버는 CTL 서비스의 존재에 대해 아무것도 모릅니다. QMI는 사용자 공간과 모뎀간에 전송되는 메시지에 사용되는 프로토콜이라는 것을 알지 못합니다. 그러나 사용자 공간에 모든 노력을 기울이는 일은 아무런 비용없이 이루어지지 않습니다. 특히 사용자 공간에 CTL 서비스가 수행하는 작업을 관리한다는 것은 하나의 프로세스 만이 /dev/cdc-wdmX 문자 장치를 성공적으로 사용할 수 있음을 의미합니다. | ||
==Device initialization== | ==Device initialization== | ||
Line 133: | Line 138: | ||
devices in user-space. In particular, a user-space process wanting to use the QMI port will need to explicitly | devices in user-space. In particular, a user-space process wanting to use the QMI port will need to explicitly | ||
perform checks to see whether the device is ready to be used. Also, no connection statistics will be automati- | perform checks to see whether the device is ready to be used. Also, no connection statistics will be automati- | ||
- | cally gathered from the device. | + | cally gathered from the device.\\ |
+ | qmi wwan 드라이버는 사용자 공간에서 새 문자 및 네트워크 장치를 노출하기 전에 장치 초기화를 수행하지 않습니다. 특히 QMI 포트를 사용하려는 사용자 공간 프로세스는 장치를 사용할 준비가되었는지 여부를 확인하기 위해 명시 적으로 검사를 수행해야합니다. 또한 장치로부터 자동으로 연결 통계가 수집되지 않습니다. | ||
==Client allocation and releasing== | ==Client allocation and releasing== | ||
- | Following the simplicity required by the driver, and given that the driver knows nothing about the QMI pro- | + | Following the simplicity required by the driver, and given that the driver knows nothing about the QMI protocol itself, there is no built-in mechanism to handle QMI service client allocations. Every user-space process wanting to use QMI, will need to handle the allocation and releasing of Client IDs using the CTL service.\\ |
- | tocol itself, there is no built-in mechanism to handle QMI service client allocations. Every user-space process wanting to use QMI, will need to handle the allocation and releasing of Client IDs using the CTL service. | + | 드라이버가 필요로하는 단순성에 따라 드라이버가 QMI 프로토콜 자체에 대해 아무것도 모르는 경우 QMI 서비스 클라이언트 할당을 처리하는 기본 제공 메커니즘이 없습니다. QMI를 사용하고자하는 모든 사용자 공간 프로세스는 CTL 서비스를 사용하여 클라이언트 ID 할당 및 해제를 처리해야합니다. |
Leaving the Client ID releasing task to user-space also makes it impossible to make sure that all Client IDs are | Leaving the Client ID releasing task to user-space also makes it impossible to make sure that all Client IDs are | ||
- | released when a process ends. A well implemented program using the QMI protocol should try to perform | + | released when a process ends. A well implemented program using the QMI protocol should try to perform the Client ID releases before exiting, but it is assumed that unexpected terminations of the running process will end up leaving ’leaked’ Client IDs which are never released.\\ |
- | the Client ID releases before exiting, but it is assumed that unexpected terminations of the running process will | + | 클라이언트 ID 해제 작업을 사용자 공간에두면 프로세스가 끝날 때 모든 클라이언트 ID가 해제되는 것을 확인할 수 없게됩니다. QMI 프로토콜을 사용하는 잘 구현 된 프로그램은 종료하기 전에 클라이언트 ID 릴리스를 수행해야하지만 실행중인 프로세스의 예기치 않은 종료로 인해 결코 누출되지 않은 '유출 된'클라이언트 ID가 남게됩니다. |
- | end up leaving ’leaked’ Client IDs which are never released. | + | |
- | This limitation, though, provides itself a very useful feature which was not possible before with the GobiNet | + | This limitation, though, provides itself a very useful feature which was not possible before with the GobiNet driver. The fact that a program can choose whether or not to release a Client ID when exiting means that it can also choose to reuse a Client ID that was maybe allocated in a previous run of the same program. From a practical point of view, the fact that the kernel doesn’t automatically release the clients when the process exits allows users to use the QMI protocol from within scripts or the command line, as there is no need to allocate or release a client in each run of the script or command line program. For most operations that can be performed through QMI, allocating/releasing a new client for each operation is a possibility, but there are some very specific use cases (e.g. WDS Start Network to setup a network connection) which require the Client ID to be kept registered all the time (or the connection will be dropped).\\ |
- | driver. The fact that a program can choose whether or not to release a Client ID when exiting means that it | + | 이 제한은 GobiNet 드라이버로는 불가능했던 매우 유용한 기능을 제공합니다. 프로그램이 종료 할 때 클라이언트 ID를 해제할지 여부를 선택할 수 있다는 사실은 동일한 프로그램의 이전 실행에서 할당되었을 수있는 클라이언트 ID를 다시 사용할 수도 있음을 의미합니다. 실용적인 관점에서 볼 때 커널이 프로세스를 종료 할 때 자동으로 클라이언트를 해제하지 않는다는 사실은 사용자가 클라이언트를 할당하거나 해제 할 필요가 없기 때문에 사용자가 스크립트 또는 명령 줄에서 QMI 프로토콜을 사용할 수있게합니다. 각 스크립트 또는 명령 행 프로그램 실행. QMI를 통해 수행 할 수있는 대부분의 작업의 경우 각 작업에 대해 새 클라이언트를 할당 / 해제하는 것이 가능하지만 Client ID가 유지되어야하는 몇 가지 매우 구체적인 사용 사례가 있습니다 (예 : WDS 네트워크 시작 네트워크) 항상 등록됩니다 (또는 연결이 끊어집니다). |
- | can also choose to reuse a Client ID that was maybe allocated in a previous run of the same program. From | + | |
- | a practical point of view, the fact that the kernel doesn’t automatically release the clients when the process | + | |
- | exits allows users to use the QMI protocol from within scripts or the command line, as there is no need to | + | |
- | allocate or release a client in each run of the script or command line program. For most operations that can | + | |
- | be performed through QMI, allocating/releasing a new client for each operation is a possibility, but there are | + | |
- | some very specific use cases (e.g. WDS Start Network to setup a network connection) which require the Client | + | |
- | ID to be kept registered all the time (or the connection will be dropped). | + | |
- | It is worth noting again that avoiding complex operations like these in the kernel driver is by no means a | + | It is worth noting again that avoiding complex operations like these in the kernel driver is by no means a limitation of the driver; instead, the driver is kept as simple as possible and therefore much more robust. A simple driver is also much more flexible, as user-space processes can process all the logic of the protocol, not just parts of it.\\ |
- | limitation of the driver; instead, the driver is kept as simple as possible and therefore much more robust. A | + | 커널 드라이버에서 이와 같은 복잡한 작업을 피하는 것이 결코 드라이버의 한계가 아니라는 점을 다시 한번 주목할 필요가 있습니다. 대신 드라이버는 가능한 단순하게 유지되므로 훨씬 강력합니다. 간단한 드라이버는 사용자 공간 프로세스가 프로토콜의 일부분뿐만 아니라 모든 논리를 처리 할 수 있기 때문에 더욱 유연합니다. |
- | simple driver is also much more flexible, as user-space processes can process all the logic of the protocol, not | + | |
- | just parts of it. | + | |
====User space==== | ====User space==== | ||
- | It should be obvious by now that while using the one exposed by qmi wwan is a much more complex task. Still, there are already free and open source projects out there that make it equally easy - if not easier - to use the qmi wwan driver. | + | It should be obvious by now that while using the one exposed by qmi wwan is a much more complex task. Still, there are already free and open source projects out there that make it equally easy - if not easier - to use the qmi wwan driver.\\ |
+ | qmi wwan에 의해 노출 된 것을 사용하는 것이 훨씬 더 복잡한 작업이라는 것을 지금 당연히 알아야합니다. 아직 qmi wwan 드라이버를 사용하는 것이 쉽지는 않겠지만 이미 무료 및 오픈 소스 프로젝트가 있습니다. | ||
This section shows some of the currently available software implementations using the qmi wwan kernel drivers. | This section shows some of the currently available software implementations using the qmi wwan kernel drivers. | ||
+ | 이 절에서는 qmi wwan 커널 드라이버를 사용하는 현재 사용 가능한 소프트웨어 구현 중 일부를 보여줍니다. | ||
===libqmi using qmi wwan=== | ===libqmi using qmi wwan=== | ||
- | libqmi is a free and open source library developed by free software contributors, and managed in the freedesktop.org public repositories. libqmi exposes a code source repository with the latest fixes available, which makes it perfect to be able to get the most recent improve-ments and fixes. | + | libqmi is a free and open source library developed by free software contributors, and managed in the freedesktop.org public repositories. libqmi exposes a code source repository with the latest fixes available, which makes it perfect to be able to get the most recent improve-ments and fixes.\\ |
+ | libqmi는 무료 소프트웨어 제공자가 개발하고 freedesktop.org 공용 저장소에서 관리되는 무료 오픈 소스 라이브러리입니다. libqmi는 최신 수정 사항을 제공하는 코드 소스 저장소를 제공하므로 가장 최근의 개선 사항 및 수정 사항을 얻을 수 있습니다. | ||
- | Most Linux-based distributions already include packages for libqmi, and it is also used by ModemManager, a mobile connection manager widely used along with NetworkManager. | + | Most Linux-based distributions already include packages for libqmi, and it is also used by ModemManager, a mobile connection manager widely used along with NetworkManager.\\ |
+ | 대부분의 Linux 기반 배포판에는 이미 libqmi 용 패키지가 포함되어 있으며 NetworkManager와 함께 널리 사용되는 모바일 연결 관리자 인 ModemManager에서도 사용됩니다. | ||
- | This C library relies on the GLib, GObject and GIO libraries to provide a very high level interface to interact with QMI modems when the qmi wwan kernel driver is being used. | + | This C library relies on the GLib, GObject and GIO libraries to provide a very high level interface to interact with QMI modems when the qmi wwan kernel driver is being used. \\ |
+ | 이 C 라이브러리는 GLib, GObject 및 GIO 라이브러리를 사용하여 qmi wwan 커널 드라이버를 사용할 때 QMI 모뎀과 상호 작용할 수있는 매우 높은 수준의 인터페이스를 제공합니다. | ||
{{wiki:2inchlte:ltemodem:libqmi_in_user_space.jpg}} | {{wiki:2inchlte:ltemodem:libqmi_in_user_space.jpg}} | ||
- | |||
==Device initialization== | ==Device initialization== | ||
Line 184: | Line 184: | ||
to the one done by the GobiNet driver when it detects a new modem, but triggered in user-space instead of in | to the one done by the GobiNet driver when it detects a new modem, but triggered in user-space instead of in | ||
the kernel. Being optional, the program can decide to fully skip doing it if it knows that the device is already | the kernel. Being optional, the program can decide to fully skip doing it if it knows that the device is already | ||
- | initialized. | + | initialized.\\ |
+ | QMI 제어를 위해 /dev/cdc-wdmX 문자 장치를 사용하려는 프로그램은 장치의 여는 순서 중에 '버전 확인'을 실행하도록 지정할 수 있습니다. 이 검사는 모뎀이 올바른 응답으로 응답 할 때까지 CTL Version Info 요청을 주기적으로 전송합니다. 따라서 새 모뎀을 발견했지만 GobiNet 드라이버에서 수행 한 것과 동등하지만, 커널 대신에 사용자 공간에서 트리거됩니다. 선택사항인 경우, 프로그램은 장치가 이미 초기화되었다는 것을 알고 있으면 이를 건너 뛸 수 있습니다. | ||
The steps that libqmi will perform while opening the QMI control port are specified in a bitmask of flags, and | The steps that libqmi will perform while opening the QMI control port are specified in a bitmask of flags, and | ||
these also may include configuring the format of network packets to be transferred through the data network | these also may include configuring the format of network packets to be transferred through the data network | ||
- | interface. | + | interface.\\ |
+ | QMI 제어 포트를 여는 동안 libqmi가 수행하는 단계는 플래그의 비트 마스크에 지정되며 데이터 네트워크 인터페이스를 통해 전송할 네트워크 패킷의 형식을 구성하는 것도 포함될 수 있습니다. | ||
==Client allocation and releasing== | ==Client allocation and releasing== |