Lines Matching refs:trap_data
470 struct prestera_trap_data *trap_data; in prestera_devlink_traps_register() local
474 trap_data = kzalloc(sizeof(*trap_data), GFP_KERNEL); in prestera_devlink_traps_register()
475 if (!trap_data) in prestera_devlink_traps_register()
478 trap_data->trap_items_arr = kcalloc(traps_count, in prestera_devlink_traps_register()
481 if (!trap_data->trap_items_arr) { in prestera_devlink_traps_register()
486 trap_data->sw = sw; in prestera_devlink_traps_register()
487 trap_data->traps_count = traps_count; in prestera_devlink_traps_register()
488 sw->trap_data = trap_data; in prestera_devlink_traps_register()
513 kfree(trap_data->trap_items_arr); in prestera_devlink_traps_register()
515 kfree(trap_data); in prestera_devlink_traps_register()
522 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_get_trap_item_by_cpu_code() local
526 for (i = 0; i < trap_data->traps_count; i++) { in prestera_get_trap_item_by_cpu_code()
529 return &trap_data->trap_items_arr[i]; in prestera_get_trap_item_by_cpu_code()
554 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_devlink_trap_item_lookup() local
559 return &trap_data->trap_items_arr[i]; in prestera_devlink_trap_item_lookup()
606 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_devlink_traps_unregister() local
618 kfree(trap_data->trap_items_arr); in prestera_devlink_traps_unregister()
619 kfree(trap_data); in prestera_devlink_traps_unregister()