요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
============
Device table
============
Matching of PCMCIA devices to drivers is done using one or more of the
following criteria:
- manufactor ID
- card ID
- product ID strings _and_ hashes of these strings
- function ID
- device function (actual and pseudo)
You should use the helpers in include/pcmcia/device_id.h for generating the
struct pcmcia_device_id[] entries which match devices to drivers.
If you want to match product ID strings, you also need to pass the crc32
hashes of the string to the macro, e.g. if you want to match the product ID
string 1, you need to use
PCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)),
If the hash is incorrect, the kernel will inform you about this in "dmesg"
upon module initialization, and tell you of the correct hash.
You can determine the hash of the product ID strings by catting the file
"modalias" in the sysfs directory of the PCMCIA device. It generates a string
in the following form:
pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
The hex value after "pa" is the hash of product ID string 1, after "pb" for
string 2 and so on.
Alternatively, you can use crc32hash (see tools/pcmcia/crc32hash.c)
to determine the crc32 hash. Simply pass the string you want to evaluate
as argument to this program, e.g.:
$ tools/pcmcia/crc32hash "Dual Speed"
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Device와 driver의 match 기준
1-15PCMCIA device와 driver의 match에는 manufacturer ID, card ID, product ID 문자열과 그 문자열의 hash, function ID, 실제 또는 pseudo device function 가운데 하나 이상을 사용합니다.
Device를 driver에 match하는 `struct pcmcia_device_id[]` entry는 `include/pcmcia/device_id.h`의 helper로 생성해야 합니다.
ID와 function 정보를 조합해 device table entry를 만듭니다.
============
Device table
============
Matching of PCMCIA devices to drivers is done using one or more of the
following criteria:
- manufactor ID
- card ID
- product ID strings _and_ hashes of these strings
- function ID
- device function (actual and pseudo)
You should use the helpers in include/pcmcia/device_id.h for generating the
struct pcmcia_device_id[] entries which match devices to drivers.
Product ID 문자열과 CRC32 hash
16-24Product ID 문자열을 match하려면 macro에 문자열뿐 아니라 그 문자열의 CRC32 hash도 전달해야 합니다. Product ID string 1을 match하는 형식은 아래와 같습니다.
PCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)),
Hash가 틀리면 module 초기화 때 kernel이 `dmesg`에 mismatch를 알리고 올바른 hash를 함께 출력합니다.
If you want to match product ID strings, you also need to pass the crc32
hashes of the string to the macro, e.g. if you want to match the product ID
string 1, you need to use
PCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)),
If the hash is incorrect, the kernel will inform you about this in "dmesg"
upon module initialization, and tell you of the correct hash.
modalias와 crc32hash로 hash 구하기
25-37PCMCIA device의 sysfs directory에서 `modalias` file을 읽으면 product ID 문자열 hash를 확인할 수 있습니다.
pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
`pa` 뒤 hexadecimal 값은 product ID string 1의 hash, `pb` 뒤 값은 string 2의 hash이며 이후도 같은 방식입니다.
대안으로 `tools/pcmcia/crc32hash.c`의 `crc32hash`에 검사할 문자열을 인자로 전달할 수 있습니다.
$ tools/pcmcia/crc32hash "Dual Speed"
Sysfs alias에서 읽거나 kernel tree의 helper로 직접 계산합니다.
You can determine the hash of the product ID strings by catting the file
"modalias" in the sysfs directory of the PCMCIA device. It generates a string
in the following form:
pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
The hex value after "pa" is the hash of product ID string 1, after "pb" for
string 2 and so on.
Alternatively, you can use crc32hash (see tools/pcmcia/crc32hash.c)
to determine the crc32 hash. Simply pass the string you want to evaluate
as argument to this program, e.g.:
$ tools/pcmcia/crc32hash "Dual Speed"
요약·해설
devicetable.rst:1-37PCMCIA는 manufacturer·card·product·function 정보를 조합해 driver와 match합니다. Product ID 문자열은 CRC32 hash를 함께 제공해야 하며 sysfs `modalias`, dmesg 보정 안내, `crc32hash` 도구로 확인할 수 있습니다.