Base Framework
|
IEEE-1394 (FireWire) More...
#include <base/communication/IEEE1394.h>
Inherits CommunicationsPort, and IEEE1394Common.
Classes | |
struct | BusInfo |
class | BusReset |
IEEE 1394 bus reset exception. More... | |
struct | ConfigurationIntro |
struct | IsochronousPacketHeader |
struct | NodeDescriptor |
Public Types | |
enum | CSRRegister { STATE_CLEAR = 0x0000, STATE_SET = 0x0004, NODE_IDS = 0x0008, RESET_START = 0x000c, SPLIT_TIMEOUT_HI = 0x0018, SPLIT_TIMEOUT_LO = 0x001c, ARGUMENT_HI = 0x0020, ARGUMENT_LO = 0x0024, TEST_START = 0x0028, TEST_STATUS = 0x002c, BUS_DEPENDENT = 0x0200, CYCLE_TIME = 0x0200, BUS_TIME = 0x0204, POWER_FAIL_IMMINENT = 0x0208, POWER_SOURCE = 0x020c, BUSY_TIMEOUT = 0x0210, BUS_MANAGER_ID = 0x021c, BANDWIDTH_AVAILABLE = 0x0220, CHANNELS_AVAILABLE_HI = 0x0224, CHANNELS_AVAILABLE_LO = 0x0228, BROADCAST_CHANNEL = 0x0234, CONFIGURATION_ROM = 0x0400, BUS_INFO_BLOCK = CONFIGURATION_ROM + 0x04, BUS_INFO_NAME = BUS_INFO_BLOCK, BUS_INFO_FLAGS = BUS_INFO_BLOCK + 0x04, BUS_INFO_GUID = BUS_INFO_BLOCK + 0x08, FCP_COMMAND_FRAME = 0x0b00, FCP_COMMAND_FRAME_END = 0x0d00, FCP_RESPONSE_FRAME = 0x0d00, FCP_RESPONSE_FRAME_END = 0x0f00, TOPOLOGY_MAP = 0x1000, TOPOLOGY_MAP_END = 0x1400, SPEED_MAP = 0x2000, SPEED_MAP_END = 0x3000 } |
enum | CSRKeyType { KEY_TYPE_IMMEDIATE = 0x00, KEY_TYPE_OFFSET = 0x01, KEY_TYPE_LEAF = 0x02, KEY_TYPE_DIRECTORY = 0x03 } |
enum | CSRKeyValue { KEY_00 = 0x00, KEY_TEXTUAL = 0x01, KEY_BUS_DEPENDENT_INFORMATION = 0x02, KEY_MODULE_VENDOR_ID = 0x03, KEY_MODULE_HARDWARE_VERSION = 0x04, KEY_SPECIFICATION_ID = 0x05, KEY_MODULE_SOFTWARE_VERSION = 0x06, KEY_MODULE_DEPENDENT_INFORMATION = 0x07, KEY_NODE_VENDOR_ID = 0x08, KEY_NODE_HARDWARE_VERSION = 0x09, KEY_NODE_SPECIFICATION_ID = 0x0a, KEY_NODE_SOFTWARE_VERSION = 0x0b, KEY_NODE_CAPABILITIES = 0x0c, KEY_NODE_UNIQUE_ID = 0x0d, KEY_NODE_UNITS_EXTENT = 0x0e, KEY_NODE_MEMORY_EXTENT = 0x0f, KEY_NODE_DEPENDENT_INFORMATION = 0x10, KEY_UNIT_DIRECTORY = 0x11, KEY_UNIT_SPECIFICATION_ID = 0x12, KEY_UNIT_SOFTWARE_VERSION = 0x13, KEY_UNIT_DEPENDENT_INFORMATION = 0x14, KEY_MODEL = 0x17, KEY_INSTANCE = 0x18, KEY_KEYWORD = 0x19, KEY_FEATURE = 0x1a, KEY_3f = 0x3f } |
enum | PowerClass { POWER_NO_REPEAT, POWER_PROVIDES_15W, POWER_PROVIDES_30W, POWER_PROVIDES_45W, POWER_CONSUMES_1W, POWER_CONSUMES_3W, POWER_CONSUMES_6W, POWER_CONSUMES_10W } |
enum | Role { BUS_MANAGER, ISOCHRONOUS_RESOURCE_MANAGER, CYCLE_MASTER, ROOT } |
enum | ExceptionCause { NODE_NOT_PRESENT, NO_GENERAL_CONFIGURATION_ROM, INVALID_BUS_INFORMATION_BLOCK, INVALID_ROOT_DIRECTORY_BLOCK, INVALID_DEVICE_INDEPENDENT_BLOCK, INVALID_DEVICE_DEPENDENT_BLOCK, UNABLE_TO_OPEN_CHANNEL, INVALID_REQUEST, REQUEST_NOT_READY, REQUEST_NOT_PENDING, UNABLE_TO_READ, UNABLE_TO_WRITE, LAST_CAUSE } |
enum | Capability { ISOCHRONOUS_RESOURCE_MANAGER_CAPABLE = 1 << 0, CYCLE_MASTER_CAPABLE = 1 << 1, ISOCHRONOUS_TRANSACTION_CAPABLE = 1 << 2, BUS_MASTER_CAPABLE = 1 << 3, POWER_MANAGER_CAPABLE = 1 << 4 } |
enum | PortState { PORT_NOT_CONNECTED, PORT_CONNECTED_TO_OHTER_LAYER, PORT_CONNECTED_TO_PARENT, PORT_CONNECTED_TO_CHILD } |
![]() | |
enum | Standard { STANDARD_UNSPECIFIED, STANDARD_IEEE_1394, STANDARD_IEEE_1394A, STANDARD_IEEE_1394B } |
enum | IsochronousRequestType { NOT_A_REQUEST, READ_PACKETS_REQUEST, READ_FIXED_PACKETS_REQUEST, READ_FIXED_DATA_REQUEST, WRITE_PACKETS_REQUEST, WRITE_FIXED_PACKETS_REQUEST, WRITE_DATA_REQUEST } |
enum | IsochronousRequestStatus { READY, PENDING, ERROR, TIMEDOUT, COMPLETED } |
enum | Status { STATUS_OK, STATUS_INCOMPATIBLE, STATUS_INTERNAL, STATUS_CONFLICT, STATUS_BUSY, STATUS_ABORTED, STATUS_TIMEOUT, STATUS_ERROR } |
enum | Speed { S100, S200, S400, S800, S1600, S3200 } |
enum | AcknowledgeCode { ACK_RESERVED_0, ACK_COMPLETE, ACK_PENDING, ACK_RESERVED_3, ACK_BUSY_X, ACK_BUSY_A, ACK_BUSY_B, ACK_RESERVED_7, ACK_RESERVED_8, ACK_RESERVED_9, ACK_RESERVED_10, ACK_RESERVED_11, ACK_RESERVED_12, ACK_DATA_ERROR, ACK_TYPE_ERROR, ACK_RESERVED_15 } |
enum | ResponseCode { RCODE_COMPLETE, RCODE_RESERVED_1, RCODE_RESERVED_2, RCODE_RESERVED_3, RCODE_CONFLICT_ERROR, RCODE_DATA_ERROR, RCODE_TYPE_ERROR, RCODE_ADDRESS_ERROR, RCODE_RESERVED_8, RCODE_RESERVED_9, RCODE_RESERVED_10, RCODE_RESERVED_11, RCODE_RESERVED_12, RCODE_RESERVED_13, RCODE_RESERVED_14, RCODE_RESERVED_15 } |
enum | TransactionCode { TCODE_WRITE_REQUEST_FOR_DATA_QUADLET, TCODE_WRITE_REQUEST_FOR_DATA_BLOCK, TCODE_WRITE_RESPONSE, TCODE_RESERVED_3, TCODE_READ_REQUEST_FOR_DATA_QUADLET, TCODE_READ_REQUEST_FOR_DATA_BLOCK, TCODE_READ_RESPONSE_FOR_DATA_QUADLET, TOCDE_READ_RESPONSE_FOR_DATA_BLOCK, TCODE_CYCLE_START, TCODE_LOCK_REQUEST, TCODE_ISOCHRONOUS_DATA_BLOCK, TCODE_LOCK_RESPONSE, TCODE_RESERVED_12, TCODE_RESERVED_13, TCODE_RESERVED_14, TCODE_RESERVED_15 } |
enum | LockInstruction { MASK_SWAP, COMPARE_SWAP, FETCH_ADD, LITTLE_FETCH_ADD, BOUNDED_ADD, WRAP_ADD } |
enum | IsochronousRequestOption { SWAP_BYTE_ORDER = 1 } |
typedef BigEndian< uint32 > | Quadlet |
Public Member Functions | |
void | checkResetGeneration () |
unsigned short | findRole (Role role, unsigned int busId=LOCAL_BUS) |
unsigned int | getNumberOfNodes () const noexcept |
unsigned int | getLocalId () const noexcept |
unsigned int | getRootNode () const noexcept |
unsigned int | getCycleMaster () const noexcept |
unsigned int | getBusManager () const noexcept |
unsigned int | getIsochronousResourceManager () const noexcept |
unsigned int | getCycleTime (unsigned short node) |
unsigned int | getBusTime (unsigned short node) |
unsigned int | getAvailableBandwidth () |
uint64 | getAvailableIsochronousChannels () |
Speed | getMaximumSpeed (unsigned int physicalId) const |
Speed | getMaximumLinkSpeed (unsigned int physicalId) const |
Speed | getMaximumSpeedBetweenNodes (unsigned int a, unsigned int b) const |
Speed | getMaximumSpeedToNode (unsigned int physicalId) const |
Speed | getBroadcastSpeed () const |
Speed | getMaximumSpeed (uint64 nodes) const noexcept |
IEEE1394 () | |
bool | hasBeenReset () const noexcept |
void | acknowledgeReset () noexcept |
void | resetBus () |
Array< EUI64 > | getAdapters () |
void | open () |
void | open (const EUI64 &adapter) |
void | close () |
Array< EUI64 > | getNodes () noexcept |
EUI64 | getLocalIdentifier (unsigned int physicalId) const |
Standard | getCompliance (unsigned short node) |
EUI64 | getIdentifier (unsigned short node) |
unsigned int | getMaximumPayload (unsigned short node) |
unsigned int | getCapabilities (unsigned short node) |
unsigned int | getVendorId (unsigned short node) |
int | getPhysicalId (const EUI64 &guid) noexcept |
String | getDescription (unsigned short node) |
String | getKeywords (unsigned short node) |
unsigned int | getStatus () const |
unsigned int | getFIFOSize () const |
bool | isPresent (unsigned int physicalId) const noexcept |
uint64 | getLinkActiveNodes () const noexcept |
bool | isLinkLayerActive (unsigned int physicalId) const |
uint64 | getContenders () const noexcept |
bool | isContender (unsigned int physicalId) const |
bool | isTransactionCapable (unsigned int physicalId) const |
unsigned int | getGapCount (unsigned int physicalId) const |
unsigned int | getNumberOfPorts (unsigned int physicalId) const |
PortState | getPortState (unsigned int physicalId, unsigned int port) const |
unsigned int | getLocalMaximumPayload (unsigned int physicalId) const |
PowerClass | getPowerClass (unsigned int physicalId) const |
uint32 | getQuadlet (unsigned short node, uint32 offset) |
void | read (unsigned short node, uint64 address, uint8 *buffer, unsigned int size) |
void | write (unsigned short node, uint64 address, const uint8 *buffer, unsigned int size) |
unsigned int | read (unsigned short node, uint64 address, uint32 *buffer, unsigned int size, uint32 value) |
IsochronousReadChannel | getReadChannel (unsigned int maximumPacketsPerRequest, uint64 subchannels) |
IsochronousWriteChannel | getWriteChannel (unsigned int maximumPacketsPerRequest, uint64 subchannels) |
bool | wait (unsigned int milliseconds) |
void | dequeue () |
void | registerFCPListener (FunctionControlProtocolListener *listener) |
void | unregisterFCPListener () |
void | readIsochronous (unsigned int channel, IsochronousChannelListener *listener) |
Static Public Member Functions | |
static uint8 | makeCSRkey (CSRKeyType type, CSRKeyValue value) noexcept |
static CSRKeyType | getCSRKeyType (uint32 quadlet) noexcept |
static CSRKeyValue | getCSRKeyValue (uint32 quadlet) noexcept |
static unsigned int | getMaximumAsyncPayloadForSpeed (Speed speed) noexcept |
static unsigned int | getMaximumIsoPayloadForSpeed (Speed speed) noexcept |
static String | getAsString (unsigned short nodeId) noexcept |
template<class IMPL > | |
static IEEE1394 | make () noexcept |
![]() | |
static unsigned short | makeNodeId (unsigned int physicalId, unsigned int busId=0x3ff) noexcept |
static unsigned int | getBusId (unsigned short node) noexcept |
static bool | isLocalBus (unsigned short node) noexcept |
static unsigned int | getPhysicalId (unsigned short node) noexcept |
static bool | isBroadcast (unsigned short node) noexcept |
Static Public Attributes | |
static const uint64 | CSR_BASE_ADDRESS = 0xfffff0000000ULL |
![]() | |
static const unsigned int | BROADCAST = 63 |
static const unsigned int | LOCAL_BUS = 1023 |
static const unsigned int | ISOCHRONOUS_CHANNELS = 64 |
static const unsigned int | MAXIMUM_ATTEMPTS = 5 |
Protected Member Functions | |
unsigned int | getBits (unsigned int value, unsigned int offset, unsigned int size) noexcept |
EUI64 | getEUI64 (unsigned short node) |
void | loadTopologyMap () |
void | loadSpeedMap () |
void | reload () |
Protected Attributes | |
uint32 | resetGeneration = 0 |
unsigned int | numberOfNodes = 0 |
NodeDescriptor | nodes [63] |
unsigned int | localId = 0 |
unsigned int | busManagerId = 0 |
unsigned int | isochronousResourceManagerId = 0 |
unsigned int | cycleMasterId = 0 |
Speed | speedMap [63][64] |
uint64 | linkActiveNodes = 0 |
uint64 | contenderNodes = 0 |
IEEE-1394 (FireWire)
IEEE-1394 (also known as FireWire (Apple Computer) and i.LINK (Sony Corp.)) support. See 1394 Trade Association (http://www.1394ta.org).
enum IEEE1394::Capability |
Capability flags of nodes.
enum IEEE1394::CSRKeyType |
Control and status key type (see CSR Architecture).
Control and status key value (see CSR Architecture).
Control and status register (CSR).
Exception causes.
enum IEEE1394::PortState |
Port state.
enum IEEE1394::PowerClass |
Power class.
enum IEEE1394::Role |
IEEE1394::IEEE1394 | ( | ) |
Initializes IEEE 1394 with the default implementation.
|
inlinenoexcept |
Acknowledges the bus reset.
void IEEE1394::checkResetGeneration | ( | ) |
Check if the bus has been reset.
|
inline |
Closes the handle to the adapter. The adapter is destroyed when all handles have been closed.
Returns the node id of the node with the desired role.
role | The role of the desired node. |
busId | The bus id of the bus ([0; 1023]). The default is the local bus. |
Returns the adapters available.
|
staticnoexcept |
Returns a convenient string representation of the node id (e.g. "local:0" or "123:broadcast").
nodeId | The node id. |
unsigned int IEEE1394::getAvailableBandwidth | ( | ) |
Returns the available bandwidth from the current isochronous resource manager.
uint64 IEEE1394::getAvailableIsochronousChannels | ( | ) |
Returns the available isochronous channels from the current isochronous reource manager.
Speed IEEE1394::getBroadcastSpeed | ( | ) | const |
Returns the maximum broadcast speed.
|
inlinenoexcept |
Returns the physical id of the bus manager.
unsigned int IEEE1394::getBusTime | ( | unsigned short | node | ) |
Returns the bus time in seconds of the specified node. The node should be cycle master capable.
node | The node id. |
unsigned int IEEE1394::getCapabilities | ( | unsigned short | node | ) |
Returns the capabilities of the specified node.
node | The node id. |
Standard IEEE1394::getCompliance | ( | unsigned short | node | ) |
Returns the IEEE 1394 standard of the specified node.
node | The node id. |
|
inlinenoexcept |
Returns the contender nodes as a bit mask.
|
inlinestaticnoexcept |
Returns the CSR key type of the specified quadlet (native byte order).
|
inlinestaticnoexcept |
Returns the CSR key value of the specified quadlet (native byte order).
|
inlinenoexcept |
Returns the physical id of the cycle master.
unsigned int IEEE1394::getCycleTime | ( | unsigned short | node | ) |
Returns the cycle time (in units of 125 micro seconds) of the specified node. The node should be isochronous capable.
node | The node id. |
String IEEE1394::getDescription | ( | unsigned short | node | ) |
Returns a description of the specified node if available in the configuration ROM.
node | The node id. |
|
inlineprotected |
Returns the guid of the specified node.
|
inline |
Returns the size of the FIFO.
|
inline |
Returns the maximum payload of the specified local node.
physicalId | The physical id the node. |
EUI64 IEEE1394::getIdentifier | ( | unsigned short | node | ) |
Returns the unique identifier of the specified node. Raises IEEE1394Exception if the node has not general configuration ROM.
node | The node id. |
|
inlinenoexcept |
Returns the physical id of the isochronous resource manager.
String IEEE1394::getKeywords | ( | unsigned short | node | ) |
Returns the keywords (separated by space) of the specified node if available in the configuration ROM.
node | The node id. |
|
inlinenoexcept |
Returns the nodes which have the link layer activated as a bit mask.
|
inlinenoexcept |
Returns the physical id of the local node (i.e. the adapter).
EUI64 IEEE1394::getLocalIdentifier | ( | unsigned int | physicalId | ) | const |
Returns the unique identifier of the specified local node. The returned guid is invalid if the node does not have a general configuration ROM.
physicalId | The physical id of the local node. |
|
inline |
Returns the maximum payload of the specified local node.
physicalId | The physical id the node. |
|
inlinestaticnoexcept |
Returns the maximum payload for asynchronous packets for the specified speed.
|
inlinestaticnoexcept |
Returns the maximum payload for isochronous packets for the specified speed.
Speed IEEE1394::getMaximumLinkSpeed | ( | unsigned int | physicalId | ) | const |
Returns the maximum link speed of the specifed local node.
physicalId | The physical id of the node. |
unsigned int IEEE1394::getMaximumPayload | ( | unsigned short | node | ) |
Returns the maximum payload in bytes for asynchronous write transmissions addressed to the specified node.
node | The node id. |
|
noexcept |
Returns the maximum speed supported by all the specified nodes (bit mask).
Speed IEEE1394::getMaximumSpeed | ( | unsigned int | physicalId | ) | const |
Returns the maximum physical speed of the specified node.
physicalId | The physical id of the node. |
Speed IEEE1394::getMaximumSpeedBetweenNodes | ( | unsigned int | a, |
unsigned int | b | ||
) | const |
Returns the maximum speed between the specified local nodes.
a | The physical id of the first node. |
b | The physical id of the second node. |
|
inline |
Returns the maximum speed to the specified node.
physicalId | The physical id of the node. |
Returns the guid's of the available nodes on the bus. The cached guid are used.
|
inlinenoexcept |
Returns the number of nodes of the local bus.
|
inline |
Returns the maximum payload of the specified local node.
physicalId | The physical id the node. |
|
noexcept |
Returns the physical id ([0; 63[) of the node with the specified guid. The guid is allowed to be the invalid guid.
guid | The unique id of the node. |
|
inline |
Returns the state of the port of the local node.
physicalId | The physical id of the node. |
port | The port of the node. |
|
inline |
Returns the power class of the specified local node.
physicalId | The physical id the node. |
|
inline |
Read quadlet from node.
node | The node id of source node. |
offset | The offset of the quadlet from the CSR base address. |
|
inline |
Returns an isochronous read channel.
maximumPacketsPerRequest | The maximum number of packets per request. |
subchannel | Mask specifying the subchannel to reserve for this channel. |
|
inlinenoexcept |
Returns the physical id of the root node.
|
inline |
Returns the current error status.
unsigned int IEEE1394::getVendorId | ( | unsigned short | node | ) |
Returns the 24 bit module vendor id of the specified node. Please note that this vendor id does not have to be identical to the vendor id of the EUI-64 identifier.
node | The node id. |
|
inline |
Returns an isochronous write channel.
maximumPacketsPerRequest | The maximum number of packets per request. |
subchannel | Mask specifying the subchannel to reserve for this channel. |
|
inlinenoexcept |
Returns true if the bus has been reset.
|
inline |
Returns true if the specified node is a contended.
physicalId | The physical id of the node [0; 63[. |
|
inline |
Returns true if the specified node has the link layer activated.
physicalId | The physical id of the node [0; 63[. |
|
inlinenoexcept |
Returns true if the node with the specified physical id is present on the local bus.
physicalId | The physical id of the node [0; 63[. |
|
inline |
Returns true if the local node is transaction capable.
physicalId | The physical id the node. |
|
protected |
Loads the speed map from the bus manager.
|
protected |
Loads the topology map from the bus manager.
|
inlinestaticnoexcept |
Creates a IEEE 1394 object with the specified implementation.
|
inlinestaticnoexcept |
Returns the CSR key for the specified CSR key and value.
type | The type of the CSR key. |
value | The value of the CSR key. |
void IEEE1394::open | ( | ) |
Opens a connection to the primary adapter.
void IEEE1394::open | ( | const EUI64 & | adapter | ) |
Opens a connection to the specified adapter.
adapter | The id of the adapter. |
|
inline |
Read data from device. This method is only used for debugging and development.
node | The node id of source node. |
address | The base address of the memory region to read from (must be a quadlet boundary). |
buffer | The data buffer. |
size | The number of quadlets to read (not bytes!). // TAG: FIXME |
value | The default value to store in the buffer for unsuccessful reads. |
|
inline |
Read data from device.
node | The node id of source node. |
address | The base address of the memory region to read from. |
buffer | The data buffer. |
size | The number of bytes to read. |
|
protected |
Reload information from local bus.
|
inline |
Resets the bus.
|
inline |
Write data to device.
node | The node id of destination node. |
address | The base address of the memory region to write to. |
buffer | The data buffer. |
size | The number of bytes to write. |
|
protected |
The physical id of the current bus manager.
|
protected |
Mask specifying the contenders.
|
static |
The CSR base address.
|
protected |
The physical id of the current cycle master.
|
protected |
The physical id of the current isochronous resource manager.
|
protected |
Mask specifying the nodes with the link layer activated.
|
protected |
The physical id of the adapter.
|
protected |
Description of the nodes of the local bus.
|
protected |
The number of nodes of the local bus.
|
protected |
Holds the reset generation number.
|
protected |
The maximum speeds of the nodes.