Lines Matching defs:index
54 * If GID is found in MGM or MGM is empty, *index = *hash, *prev = -1
57 * if GID is found in AMGM, *index = index in AMGM, *prev = index of
60 * If no AMGM exists for given gid, *index = -1, *prev = index of last
65 u16 *hash, int *prev, int *index)
88 *index = *hash;
92 err = mthca_READ_MGM(dev, *index, mgm_mailbox);
99 if (*index != *hash) {
109 *prev = *index;
110 *index = be32_to_cpu(mgm->next_gid_index) >> 6;
111 } while (*index);
113 *index = -1;
126 int index, prev;
138 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
142 if (index != -1) {
148 index = mthca_alloc(&dev->mcg_table.alloc);
149 if (index == -1) {
155 err = mthca_READ_MGM(dev, index, mailbox);
176 mthca_err(dev, "MGM at index %x is full.\n", index);
181 err = mthca_WRITE_MGM(dev, index, mailbox);
197 mgm->next_gid_index = cpu_to_be32(index << 6);
204 if (err && link && index != -1) {
205 BUG_ON(index < dev->limits.num_mgms);
206 mthca_free(&dev->mcg_table.alloc, index);
220 int prev, index;
231 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
235 if (index == -1) {
257 err = mthca_WRITE_MGM(dev, index, mailbox);
279 err = mthca_WRITE_MGM(dev, index, mailbox);
304 BUG_ON(index < dev->limits.num_mgms);
305 mthca_free(&dev->mcg_table.alloc, index);