Lines Matching refs:lan966x
58 struct lan966x *lan966x; member
64 return lan_rd(cb->lan966x, VCAP_UPDATE_CTRL(cb->instance)); in lan966x_vcap_read_update_ctrl()
67 static void lan966x_vcap_wait_update(struct lan966x *lan966x, int instance) in lan966x_vcap_wait_update() argument
69 const struct lan966x_vcap_cmd_cb cb = { .lan966x = lan966x, in lan966x_vcap_wait_update()
78 static void __lan966x_vcap_range_init(struct lan966x *lan966x, in __lan966x_vcap_range_init() argument
85 lan966x, VCAP_MV_CFG(admin->tgt_inst)); in __lan966x_vcap_range_init()
94 lan966x, VCAP_UPDATE_CTRL(admin->tgt_inst)); in __lan966x_vcap_range_init()
96 lan966x_vcap_wait_update(lan966x, admin->tgt_inst); in __lan966x_vcap_range_init()
129 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is1_get_port_keysets() local
132 val = lan_rd(lan966x, ANA_VCAP_S1_CFG(port->chip_port, lookup)); in lan966x_vcap_is1_get_port_keysets()
189 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is2_get_port_keysets() local
193 val = lan_rd(lan966x, ANA_VCAP_S2_CFG(port->chip_port)); in lan966x_vcap_is2_get_port_keysets()
400 static void lan966x_es0_read_esdx_counter(struct lan966x *lan966x, in lan966x_es0_read_esdx_counter() argument
406 mutex_lock(&lan966x->stats_lock); in lan966x_es0_read_esdx_counter()
407 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); in lan966x_es0_read_esdx_counter()
408 counter = lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_PKTS)) + in lan966x_es0_read_esdx_counter()
409 lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); in lan966x_es0_read_esdx_counter()
410 mutex_unlock(&lan966x->stats_lock); in lan966x_es0_read_esdx_counter()
415 static void lan966x_es0_write_esdx_counter(struct lan966x *lan966x, in lan966x_es0_write_esdx_counter() argument
420 mutex_lock(&lan966x->stats_lock); in lan966x_es0_write_esdx_counter()
421 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); in lan966x_es0_write_esdx_counter()
422 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_BYTES)); in lan966x_es0_write_esdx_counter()
423 lan_wr(admin->cache.counter, lan966x, in lan966x_es0_write_esdx_counter()
425 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_BYTES)); in lan966x_es0_write_esdx_counter()
426 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); in lan966x_es0_write_esdx_counter()
427 mutex_unlock(&lan966x->stats_lock); in lan966x_es0_write_esdx_counter()
437 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_cache_write() local
447 lan_wr(keystr[i] & mskstr[i], lan966x, in lan966x_vcap_cache_write()
449 lan_wr(~mskstr[i], lan966x, in lan966x_vcap_cache_write()
455 lan_wr(actstr[i], lan966x, in lan966x_vcap_cache_write()
460 lan_wr(admin->cache.counter, lan966x, in lan966x_vcap_cache_write()
464 lan966x_es0_write_esdx_counter(lan966x, admin, start); in lan966x_vcap_cache_write()
478 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_cache_read() local
489 lan_rd(lan966x, VCAP_ENTRY_DAT(instance, i)); in lan966x_vcap_cache_read()
491 ~lan_rd(lan966x, VCAP_MASK_DAT(instance, i)); in lan966x_vcap_cache_read()
498 lan_rd(lan966x, VCAP_ACTION_DAT(instance, i)); in lan966x_vcap_cache_read()
502 lan_rd(lan966x, VCAP_CNT_DAT(instance, 0)); in lan966x_vcap_cache_read()
506 lan966x_es0_read_esdx_counter(lan966x, admin, start); in lan966x_vcap_cache_read()
516 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_range_init() local
518 __lan966x_vcap_range_init(lan966x, admin, addr, count); in lan966x_vcap_range_init()
528 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_update() local
535 lan966x, VCAP_MV_CFG(admin->tgt_inst)); in lan966x_vcap_update()
544 lan966x, VCAP_UPDATE_CTRL(admin->tgt_inst)); in lan966x_vcap_update()
546 lan966x_vcap_wait_update(lan966x, admin->tgt_inst); in lan966x_vcap_update()
554 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_move() local
570 lan966x, VCAP_MV_CFG(admin->tgt_inst)); in lan966x_vcap_move()
579 lan966x, VCAP_UPDATE_CTRL(admin->tgt_inst)); in lan966x_vcap_move()
581 lan966x_vcap_wait_update(lan966x, admin->tgt_inst); in lan966x_vcap_move()
609 lan966x_vcap_admin_alloc(struct lan966x *lan966x, struct vcap_control *ctrl, in lan966x_vcap_admin_alloc() argument
648 static void lan966x_vcap_block_init(struct lan966x *lan966x, in lan966x_vcap_block_init() argument
657 lan966x, VCAP_CORE_IDX(admin->tgt_inst)); in lan966x_vcap_block_init()
659 lan966x, VCAP_CORE_MAP(admin->tgt_inst)); in lan966x_vcap_block_init()
661 __lan966x_vcap_range_init(lan966x, admin, admin->first_valid_addr, in lan966x_vcap_block_init()
666 static void lan966x_vcap_port_key_deselection(struct lan966x *lan966x, in lan966x_vcap_port_key_deselection() argument
677 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_vcap_port_key_deselection()
678 if (!lan966x->ports[p]) in lan966x_vcap_port_key_deselection()
682 lan_wr(val, lan966x, ANA_VCAP_S1_CFG(p, l)); in lan966x_vcap_port_key_deselection()
685 ANA_VCAP_CFG_S1_ENA, lan966x, in lan966x_vcap_port_key_deselection()
691 for (int p = 0; p < lan966x->num_phys_ports; ++p) in lan966x_vcap_port_key_deselection()
692 lan_wr(0, lan966x, ANA_VCAP_S2_CFG(p)); in lan966x_vcap_port_key_deselection()
696 for (int p = 0; p < lan966x->num_phys_ports; ++p) in lan966x_vcap_port_key_deselection()
698 REW_PORT_CFG_ES0_EN, lan966x, in lan966x_vcap_port_key_deselection()
708 int lan966x_vcap_init(struct lan966x *lan966x) in lan966x_vcap_init() argument
727 admin = lan966x_vcap_admin_alloc(lan966x, ctrl, cfg); in lan966x_vcap_init()
731 lan966x_vcap_block_init(lan966x, admin, cfg); in lan966x_vcap_init()
732 lan966x_vcap_port_key_deselection(lan966x, admin); in lan966x_vcap_init()
737 dir = vcap_debugfs(lan966x->dev, lan966x->debugfs_root, ctrl); in lan966x_vcap_init()
738 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_vcap_init()
739 if (lan966x->ports[p]) { in lan966x_vcap_init()
740 vcap_port_debugfs(lan966x->dev, dir, ctrl, in lan966x_vcap_init()
741 lan966x->ports[p]->dev); in lan966x_vcap_init()
744 ANA_VCAP_S2_CFG_ENA, lan966x, in lan966x_vcap_init()
745 ANA_VCAP_S2_CFG(lan966x->ports[p]->chip_port)); in lan966x_vcap_init()
748 ANA_VCAP_CFG_S1_ENA, lan966x, in lan966x_vcap_init()
749 ANA_VCAP_CFG(lan966x->ports[p]->chip_port)); in lan966x_vcap_init()
752 REW_PORT_CFG_ES0_EN, lan966x, in lan966x_vcap_init()
753 REW_PORT_CFG(lan966x->ports[p]->chip_port)); in lan966x_vcap_init()
759 REW_STAT_CFG_STAT_MODE, lan966x, in lan966x_vcap_init()
762 lan966x->vcap_ctrl = ctrl; in lan966x_vcap_init()
767 void lan966x_vcap_deinit(struct lan966x *lan966x) in lan966x_vcap_deinit() argument
772 ctrl = lan966x->vcap_ctrl; in lan966x_vcap_deinit()
777 lan966x_vcap_port_key_deselection(lan966x, admin); in lan966x_vcap_deinit()