요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=====================================================
Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x)
=====================================================
Copyright |copy| 1993-1999 Jürgen Fischer <[email protected]>
TC1550 patches by Luuk van Dijk ([email protected])
In Revision 2 the driver was modified a lot (especially the
bottom-half handler complete()).
The driver is much cleaner now, has support for the new
error handling code in 2.3, produced less cpu load (much
less polling loops), has slightly higher throughput (at
least on my ancient test box; a i486/33Mhz/20MB).
Configuration Arguments
=======================
============ ======================================== ======================
IOPORT base io address (0x340/0x140)
IRQ interrupt level (9-12; default 11)
SCSI_ID scsi id of controller (0-7; default 7)
RECONNECT allow targets to disconnect from the bus (0/1; default 1 [on])
PARITY enable parity checking (0/1; default 1 [on])
SYNCHRONOUS enable synchronous transfers (0/1; default 1 [on])
DELAY: bus reset delay (default 100)
EXT_TRANS: enable extended translation (0/1: default 0 [off])
(see NOTES)
============ ======================================== ======================
Compile Time Configuration
==========================
(go into AHA152X in drivers/scsi/Makefile):
- DAUTOCONF
use configuration the controller reports (AHA-152x only)
- DSKIP_BIOSTEST
Don't test for BIOS signature (AHA-1510 or disabled BIOS)
- DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
override for the first controller
- DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
override for the second controller
- DAHA152X_DEBUG
enable debugging output
- DAHA152X_STAT
enable some statistics
LILO Command Line Options
=========================
::
aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY> [,<EXT_TRANS]]]]]]]
The normal configuration can be overridden by specifying a command line.
When you do this, the BIOS test is skipped. Entered values have to be
valid (known). Don't use values that aren't supported under normal
operation. If you think that you need other values: contact me.
For two controllers use the aha152x statement twice.
Symbols for Module Configuration
================================
Choose from 2 alternatives:
1. specify everything (old)::
aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
configuration override for first controller
::
aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
configuration override for second controller
2. specify only what you need to (irq or io is required; new)
io=IOPORT0[,IOPORT1]
IOPORT for first and second controller
irq=IRQ0[,IRQ1]
IRQ for first and second controller
scsiid=SCSIID0[,SCSIID1]
SCSIID for first and second controller
reconnect=RECONNECT0[,RECONNECT1]
allow targets to disconnect for first and second controller
parity=PAR0[PAR1]
use parity for first and second controller
sync=SYNCHRONOUS0[,SYNCHRONOUS1]
enable synchronous transfers for first and second controller
delay=DELAY0[,DELAY1]
reset DELAY for first and second controller
exttrans=EXTTRANS0[,EXTTRANS1]
enable extended translation for first and second controller
If you use both alternatives the first will be taken.
Notes on EXT_TRANS
==================
SCSI uses block numbers to address blocks/sectors on a device.
The BIOS uses a cylinder/head/sector addressing scheme (C/H/S)
scheme instead. DOS expects a BIOS or driver that understands this
C/H/S addressing.
The number of cylinders/heads/sectors is called geometry and is required
as base for requests in C/H/S addressing. SCSI only knows about the
total capacity of disks in blocks (sectors).
Therefore the SCSI BIOS/DOS driver has to calculate a logical/virtual
geometry just to be able to support that addressing scheme. The geometry
returned by the SCSI BIOS is a pure calculation and has nothing to
do with the real/physical geometry of the disk (which is usually
irrelevant anyway).
Basically this has no impact at all on Linux, because it also uses block
instead of C/H/S addressing. Unfortunately C/H/S addressing is also used
in the partition table and therefore every operating system has to know
the right geometry to be able to interpret it.
Moreover there are certain limitations to the C/H/S addressing scheme,
namely the address space is limited to up to 255 heads, up to 63 sectors
and a maximum of 1023 cylinders.
The AHA-1522 BIOS calculates the geometry by fixing the number of heads
to 64, the number of sectors to 32 and by calculating the number of
cylinders by dividing the capacity reported by the disk by 64*32 (1 MB).
This is considered to be the default translation.
With respect to the limit of 1023 cylinders using C/H/S you can only
address the first GB of your disk in the partition table. Therefore
BIOSes of some newer controllers based on the AIC-6260/6360 support
extended translation. This means that the BIOS uses 255 for heads,
63 for sectors and then divides the capacity of the disk by 255*63
(about 8 MB), as soon it sees a disk greater than 1 GB. That results
in a maximum of about 8 GB addressable diskspace in the partition table
(but there are already bigger disks out there today).
To make it even more complicated the translation mode might/might
not be configurable in certain BIOS setups.
This driver does some more or less failsafe guessing to get the
geometry right in most cases:
- for disks<1GB: use default translation (C/32/64)
- for disks>1GB:
- take current geometry from the partition table
(using scsicam_bios_param and accept only 'valid' geometries,
ie. either (C/32/64) or (C/63/255)). This can be extended translation
even if it's not enabled in the driver.
- if that fails, take extended translation if enabled by override,
kernel or module parameter, otherwise take default translation and
ask the user for verification. This might on not yet partitioned
disks.
References Used
===============
"AIC-6260 SCSI Chip Specification", Adaptec Corporation.
"SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h
"Writing a SCSI device driver for Linux", Rik Faith ([email protected])
"Kernel Hacker's Guide", Michael K. Johnson ([email protected])
"Adaptec 1520/1522 User's Guide", Adaptec Corporation.
Michael K. Johnson ([email protected])
Drew Eckhardt ([email protected])
Eric Youngdale ([email protected])
special thanks to Eric Youngdale for the free(!) supplying the
documentation on the chip.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Revision 2와 기본 설정 인자
1-36AHA-1520/1522 Linux SCSI driver `aha152x`는 Jürgen Fischer가 1993-1999년에 작성했고 Luuk van Dijk가 TC1550 patch를 제공했다. Revision 2에서는 특히 bottom-half handler `complete()`를 크게 바꿨다.
새 버전은 구조가 더 깨끗하고 Linux 2.3의 새 error handling을 지원한다. Polling loop를 크게 줄여 CPU load가 낮아졌고, 오래된 i486/33MHz/20MB 시험 장비에서도 throughput이 조금 높아졌다.
설정값은 base I/O address `IOPORT` 0x340 또는 0x140, IRQ 9-12 중 기본 11, controller `SCSI_ID` 0-7 중 기본 7이다. `RECONNECT`, `PARITY`, `SYNCHRONOUS`는 0/1이며 모두 기본 on, bus reset `DELAY`는 기본 100, `EXT_TRANS`는 기본 off다.
허용 범위와 기본값을 한눈에 확인합니다.
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=====================================================
Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x)
=====================================================
Copyright |copy| 1993-1999 Jürgen Fischer <[email protected]>
TC1550 patches by Luuk van Dijk ([email protected])
In Revision 2 the driver was modified a lot (especially the
bottom-half handler complete()).
The driver is much cleaner now, has support for the new
error handling code in 2.3, produced less cpu load (much
less polling loops), has slightly higher throughput (at
least on my ancient test box; a i486/33Mhz/20MB).
Configuration Arguments
=======================
============ ======================================== ======================
IOPORT base io address (0x340/0x140)
IRQ interrupt level (9-12; default 11)
SCSI_ID scsi id of controller (0-7; default 7)
RECONNECT allow targets to disconnect from the bus (0/1; default 1 [on])
PARITY enable parity checking (0/1; default 1 [on])
SYNCHRONOUS enable synchronous transfers (0/1; default 1 [on])
DELAY: bus reset delay (default 100)
EXT_TRANS: enable extended translation (0/1: default 0 [off])
(see NOTES)
============ ======================================== ======================
Compile-time 설정과 LILO override
37-74`drivers/scsi/Makefile`의 AHA152X 설정에서 `DAUTOCONF`는 AHA-152x controller가 보고한 구성을 사용한다. `DSKIP_BIOSTEST`는 AHA-1510 또는 BIOS가 꺼진 경우 BIOS signature test를 생략한다. `DSETUP0`과 `DSETUP1`은 첫째와 둘째 controller의 여덟 설정값을 덮어쓴다.
`DAHA152X_DEBUG`는 debug 출력을, `DAHA152X_STAT`은 통계를 활성화한다.
LILO command line은 `aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]` 형식이다. 이를 쓰면 정상 설정을 override하고 BIOS test를 건너뛴다. 알려진 유효값만 사용하며 controller가 둘이면 `aha152x` 문장을 두 번 쓴다.
Compile-time 기본값을 boot command line이 대체합니다.
Compile Time Configuration
==========================
(go into AHA152X in drivers/scsi/Makefile):
- DAUTOCONF
use configuration the controller reports (AHA-152x only)
- DSKIP_BIOSTEST
Don't test for BIOS signature (AHA-1510 or disabled BIOS)
- DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
override for the first controller
- DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
override for the second controller
- DAHA152X_DEBUG
enable debugging output
- DAHA152X_STAT
enable some statistics
LILO Command Line Options
=========================
::
aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY> [,<EXT_TRANS]]]]]]]
The normal configuration can be overridden by specifying a command line.
When you do this, the BIOS test is skipped. Entered values have to be
valid (known). Don't use values that aren't supported under normal
operation. If you think that you need other values: contact me.
For two controllers use the aha152x statement twice.
Module parameter 두 형식
75-121Module 설정에는 두 방식이 있다. 옛 방식은 첫 controller에 `aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS`, 둘째에 `aha152x1=...`로 모든 값을 지정한다.
새 방식은 필요한 항목만 지정하되 `irq` 또는 `io` 중 하나는 필수다. `io`, `irq`, `scsiid`, `reconnect`, `parity`, `sync`, `delay`, `exttrans` 각각에 첫째와 둘째 controller 값을 comma로 나열한다.
두 방식을 동시에 사용하면 모든 값을 지정하는 첫 번째 방식이 우선한다. `parity=PAR0[PAR1]`은 원문 표기 그대로 보존되어 있지만 다른 두 controller parameter처럼 실제 사용 시 driver가 기대하는 구분 형식을 확인해야 한다.
전체 override와 항목별 설정의 우선순위를 구분합니다.
Symbols for Module Configuration
================================
Choose from 2 alternatives:
1. specify everything (old)::
aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
configuration override for first controller
::
aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
configuration override for second controller
2. specify only what you need to (irq or io is required; new)
io=IOPORT0[,IOPORT1]
IOPORT for first and second controller
irq=IRQ0[,IRQ1]
IRQ for first and second controller
scsiid=SCSIID0[,SCSIID1]
SCSIID for first and second controller
reconnect=RECONNECT0[,RECONNECT1]
allow targets to disconnect for first and second controller
parity=PAR0[PAR1]
use parity for first and second controller
sync=SYNCHRONOUS0[,SYNCHRONOUS1]
enable synchronous transfers for first and second controller
delay=DELAY0[,DELAY1]
reset DELAY for first and second controller
exttrans=EXTTRANS0[,EXTTRANS1]
enable extended translation for first and second controller
If you use both alternatives the first will be taken.
EXT_TRANS와 BIOS geometry 추정
122-183SCSI는 block number로 sector를 주소 지정하지만 BIOS와 DOS는 cylinder/head/sector, 즉 C/H/S를 사용한다. SCSI disk는 전체 block capacity만 알기 때문에 BIOS 또는 DOS driver가 C/H/S 요청을 위해 논리적 geometry를 계산한다. 이 값은 disk의 실제 물리 geometry와 관계없는 가상값이다.
Linux 자체는 block addressing을 쓰므로 보통 영향이 없지만 partition table에도 C/H/S 값이 들어 있어 다른 운영체제와 함께 해석하려면 같은 geometry를 알아야 한다. C/H/S 주소는 최대 255 head, 63 sector, 1023 cylinder로 제한된다.
AHA-1522의 기본 변환은 head 64, sector 32로 고정하고 disk capacity를 64*32, 즉 약 1MB로 나눠 cylinder 수를 얻는다. 1023 cylinder 제한 때문에 partition table에서는 약 1GB까지만 나타낼 수 있다.
AIC-6260/6360 기반의 새 controller BIOS는 1GB보다 큰 disk에 확장 변환을 쓸 수 있다. Head 255, sector 63으로 두고 capacity를 255*63, 약 8MB로 나눠 최대 약 8GB를 표현한다. BIOS에 따라 이 mode를 설정할 수도 있고 없을 수도 있다.
Driver는 1GB 미만 disk에 기본 C/32/64 변환을 쓴다. 1GB보다 크면 먼저 `scsicam_bios_param`으로 partition table의 현재 geometry를 읽고 C/32/64 또는 C/63/255만 유효하다고 받아들인다. 이 경로에서는 driver option이 꺼져 있어도 table이 확장 geometry면 그대로 쓸 수 있다.
Partition table에서 유효 geometry를 얻지 못하면 override, kernel 또는 module parameter로 확장 변환이 켜졌는지 확인한다. 켜졌으면 확장, 아니면 기본 변환을 사용하고 사용자에게 검증을 요청한다. 아직 partition하지 않은 disk에서 이 fallback이 나타날 수 있다.
원문의 조건 분기를 block capacity에서 C/H/S 선택까지 구조화했습니다.
C/H/S 조합이 partition table에서 표현 가능한 크기를 결정합니다.
Notes on EXT_TRANS
==================
SCSI uses block numbers to address blocks/sectors on a device.
The BIOS uses a cylinder/head/sector addressing scheme (C/H/S)
scheme instead. DOS expects a BIOS or driver that understands this
C/H/S addressing.
The number of cylinders/heads/sectors is called geometry and is required
as base for requests in C/H/S addressing. SCSI only knows about the
total capacity of disks in blocks (sectors).
Therefore the SCSI BIOS/DOS driver has to calculate a logical/virtual
geometry just to be able to support that addressing scheme. The geometry
returned by the SCSI BIOS is a pure calculation and has nothing to
do with the real/physical geometry of the disk (which is usually
irrelevant anyway).
Basically this has no impact at all on Linux, because it also uses block
instead of C/H/S addressing. Unfortunately C/H/S addressing is also used
in the partition table and therefore every operating system has to know
the right geometry to be able to interpret it.
Moreover there are certain limitations to the C/H/S addressing scheme,
namely the address space is limited to up to 255 heads, up to 63 sectors
and a maximum of 1023 cylinders.
The AHA-1522 BIOS calculates the geometry by fixing the number of heads
to 64, the number of sectors to 32 and by calculating the number of
cylinders by dividing the capacity reported by the disk by 64*32 (1 MB).
This is considered to be the default translation.
With respect to the limit of 1023 cylinders using C/H/S you can only
address the first GB of your disk in the partition table. Therefore
BIOSes of some newer controllers based on the AIC-6260/6360 support
extended translation. This means that the BIOS uses 255 for heads,
63 for sectors and then divides the capacity of the disk by 255*63
(about 8 MB), as soon it sees a disk greater than 1 GB. That results
in a maximum of about 8 GB addressable diskspace in the partition table
(but there are already bigger disks out there today).
To make it even more complicated the translation mode might/might
not be configurable in certain BIOS setups.
This driver does some more or less failsafe guessing to get the
geometry right in most cases:
- for disks<1GB: use default translation (C/32/64)
- for disks>1GB:
- take current geometry from the partition table
(using scsicam_bios_param and accept only 'valid' geometries,
ie. either (C/32/64) or (C/63/255)). This can be extended translation
even if it's not enabled in the driver.
- if that fails, take extended translation if enabled by override,
kernel or module parameter, otherwise take default translation and
ask the user for verification. This might on not yet partitioned
disks.
참고 사양과 기여
184-204참고 자료는 Adaptec의 `AIC-6260 SCSI Chip Specification`, SCSI-2 표준 `X3T9.2/86-109 rev. 10h`, Rik Faith의 `Writing a SCSI device driver for Linux`, Michael K. Johnson의 `Kernel Hacker's Guide`, Adaptec `1520/1522 User's Guide`다.
Michael K. Johnson, Drew Eckhardt, Eric Youngdale이 관련 작업에 기여했고, 특히 Eric Youngdale이 chip 문서를 무료로 제공했다.
Hardware 사양, protocol 표준과 Linux driver 지침을 함께 사용했습니다.
References Used
===============
"AIC-6260 SCSI Chip Specification", Adaptec Corporation.
"SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h
"Writing a SCSI device driver for Linux", Rik Faith ([email protected])
"Kernel Hacker's Guide", Michael K. Johnson ([email protected])
"Adaptec 1520/1522 User's Guide", Adaptec Corporation.
Michael K. Johnson ([email protected])
Drew Eckhardt ([email protected])
Eric Youngdale ([email protected])
special thanks to Eric Youngdale for the free(!) supplying the
documentation on the chip.
요약·해설
aha152x.rst:1-204AHA-152x 설정, built-in과 module parameter, C/H/S 기본·확장 geometry 변환을 설명합니다.