Lines Matching full: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) in find_mgm() argument
88 *index = *hash; in find_mgm()
92 err = mthca_READ_MGM(dev, *index, mgm_mailbox); in find_mgm()
99 if (*index != *hash) { in find_mgm()
109 *prev = *index; in find_mgm()
110 *index = be32_to_cpu(mgm->next_gid_index) >> 6; in find_mgm()
111 } while (*index); in find_mgm()
113 *index = -1; in find_mgm()
126 int index, prev; in mthca_multicast_attach() local
138 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index); in mthca_multicast_attach()
142 if (index != -1) { in mthca_multicast_attach()
148 index = mthca_alloc(&dev->mcg_table.alloc); in mthca_multicast_attach()
149 if (index == -1) { in mthca_multicast_attach()
155 err = mthca_READ_MGM(dev, index, mailbox); in mthca_multicast_attach()
176 mthca_err(dev, "MGM at index %x is full.\n", index); in mthca_multicast_attach()
181 err = mthca_WRITE_MGM(dev, index, mailbox); in mthca_multicast_attach()
197 mgm->next_gid_index = cpu_to_be32(index << 6); in mthca_multicast_attach()
204 if (err && link && index != -1) { in mthca_multicast_attach()
205 BUG_ON(index < dev->limits.num_mgms); in mthca_multicast_attach()
206 mthca_free(&dev->mcg_table.alloc, index); in mthca_multicast_attach()
220 int prev, index; in mthca_multicast_detach() local
231 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index); in mthca_multicast_detach()
235 if (index == -1) { in mthca_multicast_detach()
257 err = mthca_WRITE_MGM(dev, index, mailbox); in mthca_multicast_detach()
279 err = mthca_WRITE_MGM(dev, index, mailbox); in mthca_multicast_detach()
304 BUG_ON(index < dev->limits.num_mgms); in mthca_multicast_detach()
305 mthca_free(&dev->mcg_table.alloc, index); in mthca_multicast_detach()