Lines Matching refs:trap_data
448 struct prestera_trap_data *trap_data; in prestera_devlink_traps_register() local
452 trap_data = kzalloc(sizeof(*trap_data), GFP_KERNEL); in prestera_devlink_traps_register()
453 if (!trap_data) in prestera_devlink_traps_register()
456 trap_data->trap_items_arr = kcalloc(traps_count, in prestera_devlink_traps_register()
459 if (!trap_data->trap_items_arr) { in prestera_devlink_traps_register()
464 trap_data->sw = sw; in prestera_devlink_traps_register()
465 trap_data->traps_count = traps_count; in prestera_devlink_traps_register()
466 sw->trap_data = trap_data; in prestera_devlink_traps_register()
491 kfree(trap_data->trap_items_arr); in prestera_devlink_traps_register()
493 kfree(trap_data); in prestera_devlink_traps_register()
500 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_get_trap_item_by_cpu_code() local
504 for (i = 0; i < trap_data->traps_count; i++) { in prestera_get_trap_item_by_cpu_code()
507 return &trap_data->trap_items_arr[i]; in prestera_get_trap_item_by_cpu_code()
532 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_devlink_trap_item_lookup() local
537 return &trap_data->trap_items_arr[i]; in prestera_devlink_trap_item_lookup()
584 struct prestera_trap_data *trap_data = sw->trap_data; in prestera_devlink_traps_unregister() local
596 kfree(trap_data->trap_items_arr); in prestera_devlink_traps_unregister()
597 kfree(trap_data); in prestera_devlink_traps_unregister()