sub_get_product_id

Top  Previous  Next
Got to SUB-20 page

Synopsis

int sub_mdio22( sub_handle hndl, int op, int phyad, int regad,

                                                         int data, int* content )

 

Generate IEEE 802.3 Clause 22 MDIO READ or WRITE frame. Frame format is shown here: Clause 22 MDIO frame.

Parameters

op - operation code

 

SUB_MDIO22_READ

READ operation

SUB_MDIO22_WRITE

WRITE operation

 

phyad - 5 bit PHY address

regad - 5 bit register address

data - 16 bit data for WRITE operation

*content - 16 bit register content placeholder for READ operation

Return value

On success function returns 0. Otherwise error code.

Example

/* Read register 0x12 in PHY 1 */

rc = sub_mdio22( hndl, SUB_MDIO22_READ, 0x01, 0x12, 0, &content );

/* Write register 0x5 in PHY 2 */

rc = sub_mdio22( hndl, SUB_MDIO22_WRITE, 0x02, 0x05, 0x55AA, 0 );

Compatibility

FW version

0.2.1 or grater

Library version

0.1.12.12 or grater