free_db_area 42 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static void init_db_area_idx(struct hinic_free_db_area *free_db_area) free_db_area 47 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->db_idx[i] = i; free_db_area 49 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->alloc_pos = 0; free_db_area 50 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->return_pos = HINIC_DB_MAX_AREAS; free_db_area 52 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->num_free = HINIC_DB_MAX_AREAS; free_db_area 54 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c sema_init(&free_db_area->idx_lock, 1); free_db_area 59 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_free_db_area *free_db_area = &func_to_io->free_db_area; free_db_area 62 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c down(&free_db_area->idx_lock); free_db_area 64 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->num_free--; free_db_area 66 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (free_db_area->num_free < 0) { free_db_area 67 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->num_free++; free_db_area 68 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c up(&free_db_area->idx_lock); free_db_area 72 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c pos = free_db_area->alloc_pos++; free_db_area 75 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c idx = free_db_area->db_idx[pos]; free_db_area 77 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->db_idx[pos] = -1; free_db_area 79 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c up(&free_db_area->idx_lock); free_db_area 87 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_free_db_area *free_db_area = &func_to_io->free_db_area; free_db_area 90 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c down(&free_db_area->idx_lock); free_db_area 92 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c pos = free_db_area->return_pos++; free_db_area 95 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->db_idx[pos] = idx; free_db_area 97 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c free_db_area->num_free++; free_db_area 99 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c up(&free_db_area->idx_lock); free_db_area 531 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c init_db_area_idx(&func_to_io->free_db_area); free_db_area 67 drivers/net/ethernet/huawei/hinic/hinic_hw_io.h struct hinic_free_db_area free_db_area;