static int __init hydra_probe(void) { struct zorro_dev *z = NULL; unsigned long board; int err = -ENODEV; if (load_8390_module("hydra.c")) return -ENOSYS; while ((z = zorro_find_device(ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET, z))) { board = z->resource.start; if (!request_mem_region(board, 0x10000, "Hydra")) continue; if ((err = hydra_init(ZTWO_VADDR(board)))) { release_mem_region(board, 0x10000); return err; } err = 0; } if (err == -ENODEV) { printk("No Hydra ethernet card found.\n"); unload_8390_module(); } return err; }
static int __devinit hydra_init_one(struct zorro_dev *z, const struct zorro_device_id *ent) { int err; if (!request_mem_region(z->resource.start, 0x10000, "Hydra")) return -EBUSY; if ((err = hydra_init(z))) { release_mem_region(z->resource.start, 0x10000); return -EBUSY; } return 0; }
static int hydra(int mode,int hmod,int rh1) { flist_t *l; int rc=XFER_OK,ticskip=0; sline("Hydra-%dk session",hmod*2); hydra_init(HOPT_XONXOFF|HOPT_TELENET,mode,hmod,cfgi(CFG_HRXWIN),cfgi(CFG_HTXWIN)); for(l=fl;l;l=l->next) if(l->sendas) { if(l->type==IS_REQ||!rh1) { rc=hydra_file(l->tosend,l->sendas); if(rc==XFER_ABORT)break; if(rc==XFER_OK||rc==XFER_SKIP)flexecute(l); } } else if(!rh1)flexecute(l); if(rc==XFER_ABORT) { hydra_deinit(); return 1; } rc=hydra_file(NULL,NULL); for(l=fl;l;l=l->next) if(l->sendas) { rc=cfgi(CFG_AUTOTICSKIP)?ticskip:0;ticskip=0; if(!rc||!istic(l->tosend))rc=hydra_file(l->tosend,l->sendas); else write_log("tic file '%s' auto%sed",l->tosend,rc==XFER_SKIP?"skipp":"suspend"); if(rc==XFER_ABORT)break; if(rc==XFER_OK||rc==XFER_SKIP)flexecute(l); if(rc==XFER_SKIP||rc==XFER_SUSPEND)ticskip=rc; } else flexecute(l); if(rc==XFER_ABORT) { hydra_deinit(); return 1; } rc=hydra_file(NULL,NULL); hydra_deinit(); return(rc==XFER_ABORT); }