- /* Prepare driver globals (if needed) */
- if (bin->eDrvGlb) {
- debug("Copying CE MAGIC from %p to %p..%p\n",
- &ce_magic_template, ce_magic,
- (void *)ce_magic + sizeof(*ce_magic) - 1);
- memcpy(ce_magic, &ce_magic_template, sizeof(*ce_magic));
-
- ce_setup_std_drv_globals(std_drv_glb, bin);
- ce_magic->size = sizeof(*std_drv_glb) +
- strlen(std_drv_glb->mtdparts) + 1;
- ce_dump_block(ce_magic, offsetof(struct ce_magic, drv_glb) +
- ce_magic->size);
-
- drv_glb = bin->eDrvGlb;
- memset(drv_glb, 0, sizeof(*drv_glb));
-
- drv_glb->signature = DRV_GLB_SIGNATURE;
-
- /* Local ethernet MAC address */
- memcpy(drv_glb->macAddr, std_drv_glb->kitl.mac,
- sizeof(drv_glb->macAddr));
- debug("got MAC address %02x:%02x:%02x:%02x:%02x:%02x from environment\n",
- drv_glb->macAddr[0], drv_glb->macAddr[1],
- drv_glb->macAddr[2], drv_glb->macAddr[3],
- drv_glb->macAddr[4], drv_glb->macAddr[5]);
-
- /* Local IP address */
- drv_glb->ipAddr = getenv_IPaddr("ipaddr");
-
- /* Subnet mask */
- drv_glb->ipMask = getenv_IPaddr("netmask");
-
- /* Gateway config */
- drv_glb->ipGate = getenv_IPaddr("gatewayip");
-#ifdef DEBUG
- debug("got IP address ");
- print_IPaddr(drv_glb->ipAddr);
- debug(" from environment\n");
- debug("got IP mask ");
- print_IPaddr(drv_glb->ipMask);
- debug(" from environment\n");
- debug("got gateway address ");
- print_IPaddr(drv_glb->ipGate);
- debug(" from environment\n");
-#endif
- /* EDBG services config */
- memcpy(&drv_glb->edbgConfig, &bin->edbgConfig,
- sizeof(bin->edbgConfig));
- }