firewire_bus fmn_station_control
API Reference Manual  /  4 Model-to-Model Interfaces  / 

firewire_device

Description
SIM_INTERFACE(firewire_device) {
        firewire_ack_code_t (*transfer)(conf_object_t *NOTNULL dev,
                                        dbuffer_t *packet, int crc_calculated);

        void (*reset)(conf_object_t *NOTNULL dev, uint16 id,
                      uint8 root_id,
                      uint32_array_t self_ids);
        uint32 (*get_self_id_template)(
                conf_object_t *NOTNULL dev);

        int (*get_rhb)(conf_object_t *NOTNULL dev);
        uint8 (*get_port_count)(conf_object_t *NOTNULL dev);
        uint16 (*get_port_mask)(conf_object_t *NOTNULL dev);
};
#define FIREWIRE_DEVICE_INTERFACE "firewire_device"

This interface must be implemented by all firewire devices.

transfer is called when the device receives a packet. If the crc_calculated argument is non-zero the packet's crc fields are filled in.The return code is one of:

typedef enum {
        /* Values defined in the FireWire specification */
        Firewire_Ack_Complete = 1,
        Firewire_Ack_Pending = 2,
        Firewire_Ack_Busy_X = 4,
        Firewire_Ack_Busy_A = 5,
        Firewire_Ack_Busy_B = 6,
        Firewire_Ack_Tardy = 0xb,
        Firewire_Ack_Conflict_Error = 0xc,
        Firewire_Ack_Data_Error = 0xd,
        Firewire_Ack_Type_Error = 0xe,
        Firewire_Ack_Address_Error = 0xf,
        
        /* Values not defined in FireWire but used in Simics */
        Firewire_Ack_No_Destination = 0x10, /* no destination found */
        Firewire_Ack_No_Ack = 0x11 /* no ack signal sent for packet */
} firewire_ack_code_t;

reset is called when the bus is reset. id is the new ID of the device (top 10 bits represent the bus number, and the low 6 bits the node ID). root_id is the node ID for the root node. self_ids is the list of Self-ID packets during the Self-ID phase of the reset.

An array of unsigned 32-bit integers.

typedef struct {
        size_t len;
        uint32 *data;
} uint32_array_t;

get_self_id_template is an accessor function called by the bus or other self-ID provider to provide the static parts of the Self-ID for this device. The ID and port parts will be overwritten by the Self-ID provider.

get_rhb gets the current status of the root hold off bit in the device.

get_port_count returns the number of ports the device has. The largest allowed value is 16 and the lowest 1. This should remain constant during the lifetime of the device and always return a valid value.

get_port_mask returns a bitmask. Each bit is one if that port is enabled and zero if it is disabled. The least significant bit describes port 0 and the most significant bit port 15. The bits for ports which do not exist on the device should be set to zero.

Execution Context
Cell Context for all methods.

firewire_bus fmn_station_control