+ /*
+ * Turn off source address insertion (it's faster this way),
+ * and set board online. Former doesn't work if board is
+ * already online (happens on ubareset), so we put it offline
+ * first.
+ */
+ s = splimp();
+ addr->il_csr = ILC_RESET;
+ if (ilwait(ui, "hardware diag")) {
+ is->is_if.if_flags &= ~IFF_UP;
+ splx(s);
+ return;
+ }
+ addr->il_csr = ILC_CISA;
+ while ((addr->il_csr & IL_CDONE) == 0)
+ ;
+ /*
+ * If we must reprogram this board's physical ethernet
+ * address (as for secondary XNS interfaces), we do so
+ * before putting it on line, and starting receive requests.
+ * If you try this on an older 1010 board, it will total
+ * wedge the board.
+ */
+ if (is->is_flags & ILF_SETADDR) {
+ bcopy((caddr_t)is->is_addr, (caddr_t)&is->is_isu,
+ sizeof is->is_addr);
+ addr->il_bar = is->is_ubaddr & 0xffff;
+ addr->il_bcr = sizeof is->is_addr;
+ addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|ILC_LDPA;
+ if (ilwait(ui, "setaddr"))
+ return;
+ addr->il_bar = is->is_ubaddr & 0xffff;
+ addr->il_bcr = sizeof (struct il_stats);
+ addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|ILC_STAT;
+ if (ilwait(ui, "verifying setaddr"))
+ return;
+ if (bcmp((caddr_t)is->is_stats.ils_addr, (caddr_t)is->is_addr,
+ sizeof (is->is_addr)) != 0) {
+ printf("il%d: setaddr didn't work\n", ui->ui_unit);
+ return;
+ }
+ }
+#ifdef MULTICAST
+ if (is->is_if.if_flags & IFF_PROMISC) {
+ addr->il_csr = ILC_PRMSC;
+ if (ilwait(ui, "all multi"))
+ return;
+ } else if (is->is_if.if_flags & IFF_ALLMULTI) {
+ too_many_multis:
+ addr->il_csr = ILC_ALLMC;
+ if (ilwait(ui, "all multi"))
+ return;
+ else {
+ int i;
+ register struct ether_addr *ep = is->is_maddrs;
+ struct ether_multi *enm;
+ struct ether_multistep step;
+ /*
+ * Step through our list of multicast addresses. If we have
+ * too many multicast addresses, or if we have to listen to
+ * a range of multicast addresses, turn on reception of all
+ * multicasts.
+ */
+ i = 0;
+ ETHER_FIRST_MULTI(step, &is->is_ac, enm);
+ while (enm != NULL) {
+ if (++i > 63 && k != 0) {
+ break;
+ }
+ *ep++ = *(struct ether_addr *)enm->enm_addrlo;
+ ETHER_NEXT_MULTI(step, enm);
+ }
+ if (i = 0) {
+ /* no multicasts! */
+ } else if (i <= 63) {
+ addr->il_bar = is->is_ubaddr & 0xffff;
+ addr->il_bcr = i * sizeof (struct ether_addr);
+ addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|
+ LC_LDGRPS;
+ if (ilwait(ui, "load multi"))
+ return;
+ } else {
+ is->is_if.if_flags |= IFF_ALLMULTI;
+ goto too_many_multis;
+ }
+ }
+#endif MULTI