• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/infiniband/hw/ipath/

Lines Matching defs:qpt

42 #define mk_qpn(qpt, map, off)	(((map) - (qpt)->map) * BITS_PER_PAGE + \
85 static void get_map_page(struct ipath_qp_table *qpt, struct qpn_map *map)
94 spin_lock_irqsave(&qpt->lock, flags);
99 spin_unlock_irqrestore(&qpt->lock, flags);
103 static int alloc_qpn(struct ipath_qp_table *qpt, enum ib_qp_type type)
115 map = &qpt->map[0];
117 get_map_page(qpt, map);
130 qpn = qpt->last + 1;
134 map = &qpt->map[qpn / BITS_PER_PAGE];
135 max_scan = qpt->nmaps - !offset;
138 get_map_page(qpt, map);
146 qpt->last = qpn;
151 qpn = mk_qpn(qpt, map, offset);
168 if (qpt->nmaps == QPNMAP_ENTRIES)
170 map = &qpt->map[qpt->nmaps++];
172 } else if (map < &qpt->map[qpt->nmaps]) {
176 map = &qpt->map[0];
179 qpn = mk_qpn(qpt, map, offset);
188 static void free_qpn(struct ipath_qp_table *qpt, u32 qpn)
192 map = qpt->map + qpn / BITS_PER_PAGE;
200 * @qpt: the QP table
207 static int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
213 ret = alloc_qpn(qpt, type);
219 spin_lock_irqsave(&qpt->lock, flags);
221 ret %= qpt->max;
222 qp->next = qpt->table[ret];
223 qpt->table[ret] = qp;
226 spin_unlock_irqrestore(&qpt->lock, flags);
235 * @qpt: the QP table
241 static void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
247 spin_lock_irqsave(&qpt->lock, flags);
250 qpp = &qpt->table[qp->ibqp.qp_num % qpt->max];
261 spin_unlock_irqrestore(&qpt->lock, flags);
266 free_qpn(qpt, qp->ibqp.qp_num);
273 * @qpt: the QP table to empty
275 void ipath_free_all_qps(struct ipath_qp_table *qpt)
281 for (n = 0; n < qpt->max; n++) {
282 spin_lock_irqsave(&qpt->lock, flags);
283 qp = qpt->table[n];
284 qpt->table[n] = NULL;
285 spin_unlock_irqrestore(&qpt->lock, flags);
289 free_qpn(qpt, qp->ibqp.qp_num);
297 for (n = 0; n < ARRAY_SIZE(qpt->map); n++) {
298 if (qpt->map[n].page)
299 free_page((unsigned long)qpt->map[n].page);
305 * @qpt: the QP table
311 struct ipath_qp *ipath_lookup_qpn(struct ipath_qp_table *qpt, u32 qpn)
316 spin_lock_irqsave(&qpt->lock, flags);
318 for (qp = qpt->table[qpn % qpt->max]; qp; qp = qp->next) {
325 spin_unlock_irqrestore(&qpt->lock, flags);