Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
0003  */
0004 #ifndef _SJA1105_DYNAMIC_CONFIG_H
0005 #define _SJA1105_DYNAMIC_CONFIG_H
0006 
0007 #include "sja1105.h"
0008 #include <linux/packing.h>
0009 
0010 /* Special index that can be used for sja1105_dynamic_config_read */
0011 #define SJA1105_SEARCH      -1
0012 
0013 struct sja1105_dyn_cmd;
0014 
0015 struct sja1105_dynamic_table_ops {
0016     /* This returns size_t just to keep same prototype as the
0017      * static config ops, of which we are reusing some functions.
0018      */
0019     size_t (*entry_packing)(void *buf, void *entry_ptr, enum packing_op op);
0020     void (*cmd_packing)(void *buf, struct sja1105_dyn_cmd *cmd,
0021                 enum packing_op op);
0022     size_t max_entry_count;
0023     size_t packed_size;
0024     u64 addr;
0025     u8 access;
0026 };
0027 
0028 struct sja1105_mgmt_entry {
0029     u64 tsreg;
0030     u64 takets;
0031     u64 macaddr;
0032     u64 destports;
0033     u64 enfport;
0034     u64 index;
0035 };
0036 
0037 extern const struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN];
0038 extern const struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN];
0039 extern const struct sja1105_dynamic_table_ops sja1110_dyn_ops[BLK_IDX_MAX_DYN];
0040 
0041 #endif