How to Use Your STS With The EtherLite Driver VERSION: This is my version 2_cjc_2 (Feb 16, 2001) of the STS patch to the EtherLite driver version els-1.02-1 (40002090B.src.rpm 10/29/2000). REQUIREMENTS: - This distribution (Digi's Linux EtherLite Drivers + my patch) - Have the Linux SCSI Generic driver working (either in the kernel or as a module). - Have both LUNs of your STS detected during kernel startup. HISTORY: So, I've been trying to get this one old Motorola STS working under Linux for a long time now. Finally, I started work on it, and created a tool called "cdscsid" which basically tricks the EtherLite module (els.o) into thinking it's dealing with a "regular" EtherLite device. Several changes have been made to the els.o driver for compatibility (it didn't recognize the STS product names, obviously). All I've had available to test with have been an ancient Motorola STS-S16P and a Central Data ST-1620. If you have other STS devices, please add them to sts_unittab.c near the top and email me about it so I can add it to my driver as well. So, basically, follow all the instructions as you would for a regular EtherLite device, but where it wants an IP address, give the SCSI address for the LUN 0 of your STS. If your STS is on host 0, channel 0, ID 3, LUN 0, then you want to give "0.0.3.0". STEPS: 1) verify both your STS's LUNs are visible. When I do a "cat /proc/scsi/scsi" I see this for my STS: Host: scsi0 Channel: 00 Id: 02 Lun: 00 Vendor: MOTOROLA Model: STS-S16P Rev: V4.1 Type: Communications ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 02 Lun: 01 Vendor: MOTOROLA Model: STS-S16P Rev: V4.1 Type: Communications ANSI SCSI revision: 02 Most people with see their "Vendor" as either "CenData" or "DigiIntl". Most CenData and DigiIntl devices start with "ST-" and are followed by a number. If you don't see both LUNs ("Lun: 00" and "Lun: 01") either: a) edit /etc/lilo.conf (or whatever you use) and add the kernel command line option "max_scsi_luns=2": append="max_scsi_luns=2" Run "lilo" and reboot. (I actually use "max_scsi_luns=8") b) Recompile your kernel to "scan all LUNs". Install, and reboot. 2) compile this package ("make") 3) insert the els.o module ("insmod ./els.o") 4) edit /etc/els.conf to have the els device name, the STS model name, and the location of the SCSI generic driver: els00 STS-S16P 0.0.2.0 5) run "./cdmkmods -auto" to make all the /dev/ttyN* devices, /dev/dg/els/els00 device, and the /dev/dg/els/elsdiag device. 6) run "./cdscsid els00 0.0.2.0" (as in the example above) and you should see in syslog that it found and initialized the STS. WARNINGS: I've only tested this with a few poor Motorola STS-S8Ps, Moto STS-S16Ps, and a few Digi ST-1620s. So be warned. If you boot with your STS plugged in under Linux 2.2.x, you'll see various linux SCSI warnings: scsi: unknown device type 9 resize_dma_pool: unknown device type 9 These warnings are okay, and I wrote a patch to the linux kernel (against 2.4.0-test5: http://outflux.net/unix/software/sts/) that will get rid of them. I've had this patch approved, and it's now officially in the 2.4.x kernels. CHANGES between my patches: Version 2_cjc_2: (Feb 16, 2001) - used my improved SCSI code from my latest userspace driver. - changed the SCSI addressing mechanism. - made updates to how I pack and unpack FAS packets to maximize utilized space Version 2: (Jan 19, 2001) - merged the cdscsid code into the cdetherd.c file for easier future porting. - added ALL the STS unit information, thanks to Digi! CHANGES to regular els packages: Version 2_cjc_2: (against els-1.02-1: Feb 16, 2001) Everything from Version 2 below, and in addition: Makefile: - added "scsi_iface" and "scsi_tools" sections. els.c: - ported to Linux 2.4.x - changed wait_queue variables & initialization - re-initialized tty unit_read/write functions - changed some schedule loops to use ct_delay to reduce system time usage during timers. - added modules parameters "unit_wait" and "unit_gone" so that users can tune how long things wait before timing out. - added module author & description tags. - possibly corrected one or two bugs in how lines are shutdown and initialized. cdutils.h: - changed "NOP" to "CDNOP" to not conflict with scsi.h. els.info: - updated the RPM spec file to release "2_cjc_2" Version 2: (against els-1.02-1: Jan 19, 2001) Makefile: - added "cdscsid" program and man pages - corrected a few non-serious ${} typos to $() README.STS: - added this file cdetherd.c: - merged the cdscsid changes into this file, so that both cdetherd and cdscsid can be built from the same source file. cdscsid.1: - created this file from the cdetherd.1 man page. els.c: - added "Unloaded" kernel message - added "scsiTerminal" initialization kernel message els.info (els.spec): - changed release number to "2" - added SCSI note - added cdscsid executable and manpage to build list release.notes: - Fixed a common grammar error sts.c: - All the SCSI handling routines for cdscsid.c. This file is from my user-space pty/sts driver. sts.h: - defines I need for dealing with FAS commands and SCSI commands. Things in sts.h are sometimes duplicated in fas.h. This file is from my user-space pty/sts driver. sts_unittab.c: - added all the STS unit information that Digi gave me! - added the 38400 baud settings sts_unittab.h: - Added awareness for a maximum baud rate of 38400. - trick els by defining SFC_STD as SFC_ETH Version 1: (against els-A-7, 08/12/2000) sts.h: - defines I need for dealing with FAS commands and SCSI commands. Things in sts.h are sometimes duplicated in fas.h. This file is from my user-space pty/sts driver. sts.c: - All the SCSI handling routines for cdscsid.c. This file is from my user-space pty/sts driver. cdscsid.c: - created this file from the cdetherd.c tool. Most code changes to cdetherd.c should be in "STS_CODE" defines. cdscsid.1 - created this file from the cdetherd.1 man page. Changed whatever needed changing. :) Makefile: - added "cdscsid" program and man page els.h: - Turned off tracing (added 64k to the driver size...) els.c: - Fixed a semi-serious bug in the els.o driver itself where it returns in the middle of processing FAS packets. - Added awareness of the TIOCOUTQ and TIOCINQ ioctls. - Added an "unloaded" note when unloading the module. sts_unittab.c: - Started adding STS model information to the list. - Added awareness for a maximum baud rate of 38400. WHEN SOMETHING BLOWS UP: If stuff blows up (SCSI bus starts resetting, ports don't work) then I recommend editing "sts.h" and "define"ing STS_DEBUG, editing "Makefile" and "define"ing TRACING, and doing a "make clean" and a "make" to turn on tracing and heavy debugging. Use the "dtrcels" tool to see the els driver's trace information, and check the /tmp/els00.log for stderr from cdscsid. CAVEATS: The els.o driver needs to be accepting of STSs. Right now, I've changed "SFC_STD" to have the same value was "SFC_ETH", and marked all the regular STSs with "SFC_STD", when they shouldn't need to be. That means that els.c needs to be changed to allow non-SFC_ETH devices to work, and needs to have some of the UNIT_POLL stuff changed for STS devices. There are some notes in sts.c about it. Search for "SCSI" in els.c. ;) Feb 16, 2001 ---- Kees Cook cook@cpoint.net http://outflux.net/