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)
92 *index = *hash;
96 err = mthca_READ_MGM(dev, *index, mgm_mailbox, &status);
106 if (*index != *hash) {
116 *prev = *index;
117 *index = be32_to_cpu(mgm->next_gid_index) >> 6;
118 } while (*index);
120 *index = -1;
133 int index, prev;
146 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
150 if (index != -1) {
156 index = mthca_alloc(&dev->mcg_table.alloc);
157 if (index == -1) {
163 err = mthca_READ_MGM(dev, index, mailbox, &status);
187 mthca_err(dev, "MGM at index %x is full.\n", index);
192 err = mthca_WRITE_MGM(dev, index, mailbox, &status);
213 mgm->next_gid_index = cpu_to_be32(index << 6);
224 if (err && link && index != -1) {
225 BUG_ON(index < dev->limits.num_mgms);
226 mthca_free(&dev->mcg_table.alloc, index);
240 int prev, index;
252 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
256 if (index == -1) {
278 err = mthca_WRITE_MGM(dev, index, mailbox, &status);
307 err = mthca_WRITE_MGM(dev, index, mailbox, &status);
341 BUG_ON(index < dev->limits.num_mgms);
342 mthca_free(&dev->mcg_table.alloc, index);