STS Firmware updater for Linux
Feb 13, 2001

This package of tools will let you update the firmware of your SCSI Terminal
Server.  This package is NOT supported by Digi, and could very well
destroy your STS, so be careful.  I have put as much sanity checking into
my code as I can think of, but I've only been able to test this on 3
models of STS: Motorola STS-S16P, Motorola STS-S8P, and CenData ST-1620.  It
worked for me, so it should work for anyone else with these types of STSs.

Things to know
--------------
- The firmware files (.prm's) use an 8-bit checksum which should equal
  zero (the last byte makes sure).  "stsupdate" checks for this.
- Never upload a firmware to an STS where the vendor/product information
  doesn't match.  "stsupdate" won't let you do this, but since you have
  the source code, you can change that behavior, but you REALLY don't want
  to, since each STS has different firmware memory, ROMs, and chips.
- If something blows up badly, try to immediately re-upload the firmware,
  just in case the problem was on the bus, etc.  Don't power off your STS.
- If things go *really* badly (I haven't had this happen to me) then you'll
  have a nice box that doesn't do anything.  :)
- Linux kernel 2.2 didn't know what a "Communications" SCSI type (9) was,
  so it would put up kernel warnings.  These warnings can be safely ignored.
  Under 2.4.x, type 9 SCSI devices are correctly identified.


Where to get firmware
---------------------
You can get firmware from Digi, unless you have a Motorola STS.  In that
case, you can get the firmware from me.  Digi built those firmwares for me
since I was working on this program.  :)

Digi Firmware:
	http://support.digi.com/support/firmware/sts/
Central Data Firmware:
	ftp://ftp.digi.com/support/centraldata/firmware/
Motorola Firmware:
	http://outflux.net/unix/software/sts/download/firmware/


How to use the firmware updater
-------------------------------
- Unpack the archive (if you're reading this, you might have already)
- Run "make"
- As root, run "./scanbus" to just make sure your sg driver is working.
  You should see all the SCSI devices attached to your system listed.
- As root, run "./stsupdate".  It will scan your bus for any online,
  type 9 devices, matching the "MOTOROLA", "CenData", or "DigiIntl" vendor
  tag.
- Select the device you want to upgrade.
- Enter the name of the firmware file you want to send.
- Read any warnings, and hit enter.


Here is a screen dump of a session from me re-updating my Motorola STS.  You'll
notice the warning about not actually doing an UPgrade, but rather a SAMEgrade:

# ./stsupdate
Scanning for STSs ...
#) Host Chan  ID  Vendor     Product            Ver
-- ---- ---- ---  ---------- ------------------ ------
A)    0,   0,  1  'MOTOROLA' 'STS-S16P        ' 'V7.9'

Which STS do you want to update? (CR aborts) a

STS selected:
A)    0,   0,  1  'MOTOROLA' 'STS-S16P        ' 'V7.9'

In current directory, the firmware (*.prm) files are:
    none found!

Load which firmware image? (CR = 'stss16p.prm', Q quits) ../firmware/s16p7_9.prm

Image has firmware for the 'STS-S16P' (version 'V7.9', 65536 bytes)
*** This image (V7.9) is NOT NEWER than your current firmware (V7.9)! ***
                Are you SURE you want to continue? [y/N] y

*** Do not power off your STS during programming. ***

Remember this program might destroy your STS firmware!
Hit enter to start programming...
        Preparing for update...
        Erasing firmware ...
        Uploading firmware chunks ...
        Committing firmware ...
        Finishing update ...
Firmware successfully uploaded!
*** Please power-cycle your STS now. ***
Hit enter when ready...
Scanning for STSs ...
#) Host Chan  ID  Vendor     Product            Ver
-- ---- ---- ---  ---------- ------------------ ------
A)    0,   0,  1  'MOTOROLA' 'STS-S16P        ' 'V7.9'

Which STS do you want to update? (CR aborts)
No device selected.  Exiting...




-Kees Cook <cook@cpoint.net>
Feb 13, 2001
http://outflux.net/
