| .. | .. |
|---|
| 34 | 34 | #ifndef _HNS_ROCE_HEM_H |
|---|
| 35 | 35 | #define _HNS_ROCE_HEM_H |
|---|
| 36 | 36 | |
|---|
| 37 | | -#define HW_SYNC_TIMEOUT_MSECS 500 |
|---|
| 38 | 37 | #define HW_SYNC_SLEEP_TIME_INTERVAL 20 |
|---|
| 38 | +#define HW_SYNC_TIMEOUT_MSECS (25 * HW_SYNC_SLEEP_TIME_INTERVAL) |
|---|
| 39 | 39 | #define BT_CMD_SYNC_SHIFT 31 |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | enum { |
|---|
| .. | .. |
|---|
| 44 | 44 | HEM_TYPE_MTPT, |
|---|
| 45 | 45 | HEM_TYPE_CQC, |
|---|
| 46 | 46 | HEM_TYPE_SRQC, |
|---|
| 47 | + HEM_TYPE_SCCC, |
|---|
| 48 | + HEM_TYPE_QPC_TIMER, |
|---|
| 49 | + HEM_TYPE_CQC_TIMER, |
|---|
| 47 | 50 | |
|---|
| 48 | 51 | /* UNMAP HEM */ |
|---|
| 49 | 52 | HEM_TYPE_MTT, |
|---|
| 50 | 53 | HEM_TYPE_CQE, |
|---|
| 54 | + HEM_TYPE_SRQWQE, |
|---|
| 55 | + HEM_TYPE_IDX, |
|---|
| 51 | 56 | HEM_TYPE_IRRL, |
|---|
| 52 | 57 | HEM_TYPE_TRRL, |
|---|
| 53 | 58 | }; |
|---|
| .. | .. |
|---|
| 97 | 102 | u32 buf_chunk_size; |
|---|
| 98 | 103 | u32 bt_chunk_size; |
|---|
| 99 | 104 | u32 ba_l0_num; |
|---|
| 100 | | - u32 l0_idx;/* level 0 base address table index */ |
|---|
| 101 | | - u32 l1_idx;/* level 1 base address table index */ |
|---|
| 102 | | - u32 l2_idx;/* level 2 base address table index */ |
|---|
| 105 | + u32 l0_idx; /* level 0 base address table index */ |
|---|
| 106 | + u32 l1_idx; /* level 1 base address table index */ |
|---|
| 107 | + u32 l2_idx; /* level 2 base address table index */ |
|---|
| 103 | 108 | }; |
|---|
| 104 | 109 | |
|---|
| 105 | 110 | void hns_roce_free_hem(struct hns_roce_dev *hr_dev, struct hns_roce_hem *hem); |
|---|
| .. | .. |
|---|
| 110 | 115 | void *hns_roce_table_find(struct hns_roce_dev *hr_dev, |
|---|
| 111 | 116 | struct hns_roce_hem_table *table, unsigned long obj, |
|---|
| 112 | 117 | dma_addr_t *dma_handle); |
|---|
| 113 | | -int hns_roce_table_get_range(struct hns_roce_dev *hr_dev, |
|---|
| 114 | | - struct hns_roce_hem_table *table, |
|---|
| 115 | | - unsigned long start, unsigned long end); |
|---|
| 116 | | -void hns_roce_table_put_range(struct hns_roce_dev *hr_dev, |
|---|
| 117 | | - struct hns_roce_hem_table *table, |
|---|
| 118 | | - unsigned long start, unsigned long end); |
|---|
| 119 | 118 | int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, |
|---|
| 120 | 119 | struct hns_roce_hem_table *table, u32 type, |
|---|
| 121 | 120 | unsigned long obj_size, unsigned long nobj, |
|---|
| .. | .. |
|---|
| 128 | 127 | struct hns_roce_hem_mhop *mhop); |
|---|
| 129 | 128 | bool hns_roce_check_whether_mhop(struct hns_roce_dev *hr_dev, u32 type); |
|---|
| 130 | 129 | |
|---|
| 130 | +void hns_roce_hem_list_init(struct hns_roce_hem_list *hem_list); |
|---|
| 131 | +int hns_roce_hem_list_calc_root_ba(const struct hns_roce_buf_region *regions, |
|---|
| 132 | + int region_cnt, int unit); |
|---|
| 133 | +int hns_roce_hem_list_request(struct hns_roce_dev *hr_dev, |
|---|
| 134 | + struct hns_roce_hem_list *hem_list, |
|---|
| 135 | + const struct hns_roce_buf_region *regions, |
|---|
| 136 | + int region_cnt, unsigned int bt_pg_shift); |
|---|
| 137 | +void hns_roce_hem_list_release(struct hns_roce_dev *hr_dev, |
|---|
| 138 | + struct hns_roce_hem_list *hem_list); |
|---|
| 139 | +void *hns_roce_hem_list_find_mtt(struct hns_roce_dev *hr_dev, |
|---|
| 140 | + struct hns_roce_hem_list *hem_list, |
|---|
| 141 | + int offset, int *mtt_cnt, u64 *phy_addr); |
|---|
| 142 | + |
|---|
| 131 | 143 | static inline void hns_roce_hem_first(struct hns_roce_hem *hem, |
|---|
| 132 | 144 | struct hns_roce_hem_iter *iter) |
|---|
| 133 | 145 | { |
|---|