cardInit

cardInit — initializes SST-PFB cards.

Synopsis

(cardInit)
(cardInit card_id)
(cardInit [card_id [port [hardware_address [intr [module]]]])
  

Parameters

card_id
The ID associated with the card initialized by this command. Up to 4 cards can be simultaneously accessed by the same driver, numbered 0 to 3. If not specified, then the next available ID (sequentially from 0) is assigned (see Description below).
port
For ISA cards, the port address as set by the SW1 card switches. See Section 1.2, “Hardware Installation” for details. If not specified, or specified as 0, then the driver will scan for SST-PFB PCI cards (see Description below).
hardware_address
For ISA cards, the hardware location of an unused 16K memory window to be used as the SST-PFB card's dual-port mapped memory block. If not specified, or specified as 0, then the driver will scan for SST-PFB PCI cards (see Description below).
intr
For ISA cards, if intr > 0, then intr specifies the interrupt associated with the card, otherwise the card will use polling mode only. For PCI cards, if intr >= 0, then the interrupt line assigned by the BIOS to the card is used, otherwise the card will use polling mode only. If intr is not specified, then this is equivalent to intr = 0, which as described above, defaults to polling for ISA cards and the assigned interrupt for PCI cards. The assignment intr = -1 should be specified to always force polling mode if desired.
[Note]

Shared interrupts are not supported, so if the same interrupt is associated with more than one card, only the first will use interrupt mode, and the remainder will use polling mode.

module
The name of the firmware file (an SST application module) to be downloaded to the SST-PFB card. If not specified, the default module file loaded is PFBPROFI.SS1.

Returns

OK if successful, otherwise one of the following:

(error "cardInit DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "cardInit PFB_ERR_NO_CARD (time) No additional SST-PFB-PCI cards detected")
(error "cardInit PFB_ERR_NO_CARD (time) No SST-PFB-PCI cards detected")
(error "cardInit PFB_ERR_NO_CARD (time) Card not available")
(error "cardInit PFB_ERR_BAD_PORT_PASSIVE (time) Card passive port signature invalid")
(error "cardInit PFB_ERR_BAD_PORT_ACTIVE (time) Card active port signature invalid")
(error "cardInit PFB_ERR_MEMMAP (time) Failed to map memory")
(error "cardInit PFB_ERR_FIRMWARE_FILENAME (time) Specified Firmware file not found")
(error "cardInit PFB_ERR_FIRMWARE_WRITE (time) Error writing firmware to card")
(error "cardInit PFB_ERR_CARD_FAILURE (time) i960 FAIL state asserted")
(error "cardInit PFB_ERR_FIRMWARE_NOT_RUNNING (time) Firmware failed to execute")
(error "cardInit PFB_ERR_BUFFER_ALLOC (time) Failed to allocate buffer memory")

Description

This command initializes one or more SST-PFB cards. A card must be initialized before it can be used. At least one card must be initialized from the configuration file to prevent the driver from terminating. The driver can interface with up to 4 cards. Each card is uniquely identified by its card ID, between 0 and 3.

ISA cards must be initilized one at a time, fully specifying the card_id, port and hardware_address parameters.

If either port or hardware_address parameters are 0 or not specified, then the command will scan the system for new SST-PFB PCI card(s) that have not yet been initialized by the driver. If card_id is also not specified, then sequential available IDs are assigned to the cards. If multiple PCI cards are detected and a card_id is specified that is not the first available ID, then the driver skips over those cards that would have corresponded to the intervening IDs.

Example

In the following example, the system will initialize an ISA card as ID 1 at port 0x250 and address 0xD0000. The card will default to polled mode.

(cardInit 1 0x250 0xD000 )

In the following example, the driver will scan for SST-PFB PCI cards in the system, identifying up to 4 cards, and assigning consecutive device IDs. The card(s) will default to interrupt mode, and following on from the previous example, would be assigned IDs of 0, then 2, and then 3.

(cardInit)

In the following example, the driver will scan for SST-PFB PCI cards. Assuming no other cards have been initialized, and 2 cards are detected, the first card is skipped, and the second is assigned an ID of 1 and forced to polling mode. The subsequent cardInit command again detects all the available cards, assigning the first an ID of 0 with interrupt mode, and skipping the second that has already been initialized.

(cardInit 1 0 0 -1)
(cardInit)