home *** CD-ROM | disk | FTP | other *** search
- From: rdg@hpfcso.FC.HP.COM (Rob Gardner)
- Date: Fri, 31 Jul 1992 20:01:50 GMT
- Subject: Re: device driver for 720
- Message-ID: <7371202@hpfcso.FC.HP.COM>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!rdg
- Newsgroups: comp.sys.hp
- References: <60041@hpfcse.HP.COM>
- Lines: 79
-
- > > 2) A "id" is required. There is no specification of what the id looks like,
- > > how to create it, set it. Again please direct me to info on how to create
- > > the device driver id.
- >
- > The id is read from the eisa card (at offset 0xC80 in its I/O space)
- > and passed into your attach routine (first argument). Is this what
- > you're talking about? Or are you asking how to create the id to be
- > programmed into the card? There might be some algorithm, but I think
- > it's also OK to choose a random 32-bit integer, since the chances
- > of collision with another vendor's id are small.
-
-
- Ah, I found the correct answer in the EISA specification. There is an
- algorithm for constructing ID's, so I wrote the attached summary. DON'T
- use a random ID as I suggested before.
-
- Rob
-
-
- Explanation of EISA ID's.
- -------------------------
-
- Construct a 7 character ID as follows: MMMPPPR
-
- MMM is a 3 character manufacturer code, consisting of only [A-Z]
- PPP is a 3 digit hex product identifier
- R is a 1 digit hex revision number.
-
- For example, HWP123A might be an ID. This is the ID that you specify
- in your EISA config file in the ID statement. For example:
-
- BOARD
- ID = "HWP123A"
- NAME = "Example"
- etc.
-
- This 7 character ID is "compressed" into a 32-bit integer which is
- found at offset 0xC80 in the I/O space of the EISA card. The
- compression happens like this:
-
- Take the least significant 5 bits of the ASCII value of each character
- in the manufacturer code, and form a 16 bit number by concatenating them
- and putting a 0 bit in the high bit:
- 0[5-bits-from-1st-char][5-bits-from-2nd-char][5-bits-from-3rd-char]
-
- Now put the high byte of this 16-bit number into 0xC80, and put the
- low byte into 0xC81.
-
- Put the high two bytes of the product identifier into 0xC82. Put
- the low byte of the product and the revision digit into 0xC83.
-
- For example, using the ID "HWP123A" we would get:
- H = ascii 0x48 = 0100 1000
- W = ascii 0x57 = 0101 0111
- P = ascii 0x50 = 0101 0000
-
- Taking the 5 bit chunks, we get:
- 0 01000 10111 10000 ===> 0x22f0
- So 0xC80 would get 0x22, and 0xC81 would get 0xf0.
-
- Handling the product id and rev code, 0xC82 would get 0x12, and 0xC83
- would get 0x3A.
-
- The entire 32 bit ID, after appropriate byte swapping would be
- 0x22f0123A. This is the value you should define in your driver to
- compare with the ID read from the card. For instance:
-
- #define MY_ID 0x22f0123A
-
- my_attach(id, isc)
- int id;
- struct isc_table_type *isc;
- {
- if (id == MY_ID) {
- /* it's my card */
- ...
- }
- return((*my_saved_attach)(id, isc));
- }
-