bfcmap_io.h (2508B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 */ 7 #ifndef BFCMAP_IO_H 8 #define BFCMAP_IO_H 9 #include <bfcmap_types.h> 10 #include <blmi_io.h> 11 12 13 /* 14 * typedef for address. 15 */ 16 typedef blmi_dev_addr_t bfcmap_dev_addr_t; 17 18 /* 19 * MACSEC I/O operation type identifier. 20 */ 21 typedef blmi_io_op_t bfcmap_io_op_t; 22 #define BFCMAP_IO_REG_RD (BLMI_IO_REG_RD) /* Register Read */ 23 #define BFCMAP_IO_REG_WR (BLMI_IO_REG_WR) /* Register Write */ 24 #define BFCMAP_IO_TBL_RD (BLMI_IO_TBL_RD) /* Table Read */ 25 #define BFCMAP_IO_TBL_WR (BLMI_IO_TBL_WR) /* Table Write */ 26 27 /* 28 * MACSEC I/O callback prototype. 29 */ 30 typedef blmi_dev_io_f bfcmap_dev_io_f; 31 32 /* 33 * MMI read callback prototype. 34 */ 35 typedef blmi_dev_mmi_mdio_rd_f bfcmap_dev_mmi_mdio_rd_f; 36 37 /* 38 * MMI write callback prototype. 39 */ 40 typedef blmi_dev_mmi_mdio_wr_f bfcmap_dev_mmi_mdio_wr_f; 41 42 /* 43 * MMI IO callback registeration. 44 */ 45 extern int 46 bfcmap_dev_mmi_mdio_register(bfcmap_dev_mmi_mdio_rd_f mmi_rd_f, 47 bfcmap_dev_mmi_mdio_wr_f mmi_wr_f); 48 49 /* 50 * MDIO I/O operation type identifier. 51 */ 52 typedef blmi_mdio_io_op_t bfcmap_mdio_io_op_t; 53 #define BFCMAP_MDIO_IO_REG_RD (BLMI_MDIO_IO_REG_RD) /* Register Read */ 54 #define BFCMAP_MDIO_IO_REG_WR (BLMI_MDIO_IO_REG_WR) /* Register Write */ 55 56 /* MMI IO routine */ 57 /* MMI I/O function for MMI version 0, i.e. device bcm545XX. */ 58 extern int 59 bfcmap_io_mmi(bfcmap_dev_addr_t dev_addr, int dev_port, 60 bfcmap_io_op_t op, buint32_t io_addr, 61 int word_sz, int num_entry, buint32_t *data); 62 63 /* MMI I/O function for MMI version 1 */ 64 extern int 65 bfcmap_io_mmi1(bfcmap_dev_addr_t dev_addr, int dev_port, 66 bfcmap_io_op_t op, buint32_t io_addr, 67 int word_sz, int num_entry, buint32_t *data); 68 69 /* MMI I/O function for MMI version 1 using clause45 */ 70 extern int 71 bfcmap_io_mmi1_cl45(bfcmap_dev_addr_t dev_addr, int dev_port, 72 bfcmap_io_op_t op, buint32_t io_addr, 73 int word_sz, int num_entry, buint32_t *data); 74 75 /* MDIO access routine. */ 76 extern int 77 bfcmap_io_mdio(bfcmap_dev_addr_t phy_addr, bfcmap_mdio_io_op_t op, 78 buint32_t io_addr, buint16_t *data); 79 80 81 #define BFCMAP_IO_CL45_ADDRESS(cl45_dev, reg) \ 82 BLMI_IO_CL45_ADDRESS(cl45_dev, reg) 83 84 #endif /* BFCMAP_IO_H */ 85