From 2c7b6f004a525b9223e3975a20ee0d70d1ba34c6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 20 May 2017 22:23:54 +0200 Subject: [PATCH 1/5] The WinPcap handler now forces non-blocking mode again. --- src/net_ne2000.c | 13 +++++++++++-- src/net_pcap.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/net_ne2000.c b/src/net_ne2000.c index 51fdd7b4e..9ea48215c 100644 --- a/src/net_ne2000.c +++ b/src/net_ne2000.c @@ -1809,12 +1809,13 @@ nic_init(int board) mac = device_get_config_int_ex("mac", -1); /* Set up our MAC address. */ +#if 0 if (dev->is_rtl8029as) { - dev->maclocal[0] = 0x00; /* 00:20:18 (RTL 8029AS PCI vendor prefix). */ + dev->maclocal[0] = 0xDE /* 0x00 */; /* 00:20:18 (RTL 8029AS PCI vendor prefix). */ dev->maclocal[1] = 0x20; dev->maclocal[2] = 0x18; } else { - dev->maclocal[0] = 0x00; /* 00:00:D8 (NE2000 ISA vendor prefix). */ + dev->maclocal[0] = 0xDE /* 0x00 */; /* 00:00:D8 (NE2000 ISA vendor prefix). */ dev->maclocal[1] = 0x00; dev->maclocal[2] = 0xD8; } @@ -1833,6 +1834,14 @@ nic_init(int board) dev->maclocal[5] = (mac & 0xff) | 1; #endif } +#else + dev->maclocal[0] = 0xac; + dev->maclocal[1] = 0xde; + dev->maclocal[2] = 0x48; + dev->maclocal[3] = 0x88; + dev->maclocal[4] = 0xbb; + dev->maclocal[5] = 0xaa; +#endif memcpy(dev->physaddr, dev->maclocal, sizeof(dev->maclocal)); pclog(1,"%s: I/O=%04x, IRQ=%d, MAC=%02x:%02x:%02x:%02x:%02x:%02x BIOS=%d\n", diff --git a/src/net_pcap.c b/src/net_pcap.c index 3ca2e9089..1a7eef1fa 100644 --- a/src/net_pcap.c +++ b/src/net_pcap.c @@ -109,6 +109,7 @@ poll_thread(void *arg) int network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) { + int rc; char temp[PCAP_ERRBUF_SIZE]; char filter_exp[255]; struct bpf_program fp; @@ -147,6 +148,43 @@ network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) return(-1); } + /* Time to check that we are in non-blocking mode. */ + rc=pcap_getnonblock(pcap,temp); + pclog("pcap is currently in %s mode\n",rc? "non-blocking":"blocking"); + + switch(rc) + { + case 0: + pclog("Setting interface to non-blocking mode.."); + rc = pcap_setnonblock(pcap,1,temp); + if (rc==0) + { /* no errors! */ + pclog(".."); + rc=pcap_getnonblock(pcap,temp); + if(rc == 1) + { + pclog("..!",rc); + } + else + { + pclog("\tunable to set pcap into non-blocking mode!\nContinuining without pcap.\n"); + return(-1); + } + } /* end set nonblock */ + else + { + pclog("There was an unexpected error of [%s]\n\nexiting.\n",temp);return(-1);} + pclog("\n"); + break; + case 1: + pclog("non blocking\n"); + break; + default: + pclog("this isn't right!!!\n"); + return(-1); + break; + } + /* Create a MAC address based packet filter. */ pclog("Building packet filter ..."); sprintf(filter_exp, From 598fd2ffd88bd23520c8e5c9acb091f97741afbe Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 20 May 2017 22:38:30 +0200 Subject: [PATCH 2/5] SVGA now again always returns 0xFF where no VRAM is found. --- src/VIDEO/vid_svga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VIDEO/vid_svga.c b/src/VIDEO/vid_svga.c index 69c954bc9..39a72ae15 100644 --- a/src/VIDEO/vid_svga.c +++ b/src/VIDEO/vid_svga.c @@ -1256,7 +1256,7 @@ uint8_t svga_read(uint32_t addr, void *p) if (svga->chain4 || svga->fb_only) { if (addr >= svga->vram_limit) - return 0x00; + return 0xff; return svga->vram[svga_mask_addr(addr, svga)]; } else if (svga->chain2_read) @@ -1274,7 +1274,7 @@ uint8_t svga_read(uint32_t addr, void *p) addr<<=2; if (addr >= svga->vram_limit) - return 0x00; + return 0xff; addr = svga_mask_addr(addr, svga); From 785cb4b421648eff5759e4e1552bafd0650161af Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 21 May 2017 02:37:22 +0200 Subject: [PATCH 3/5] PCap is now initialized with timeout 15 rather than 10; Generated MAC addresses are back, with 0xDE as first byte rather than 0x00, SLiRP DHCP still works (seems it did not like the first byte being 0x00); The FDC Read and Write commands now return the correct sector ID in the result phase when the last transferred sector equals EOT and DMA is over, fixes floppies on Windows 2000; Fixed floppy FIFO threshold handling. --- src/fdc.c | 78 +++++++++++++++++++++++++++++++++++++++++++----- src/net_ne2000.c | 2 +- src/net_pcap.c | 2 +- 3 files changed, 72 insertions(+), 10 deletions(-) diff --git a/src/fdc.c b/src/fdc.c index 9e5b66cce..7a640096b 100644 --- a/src/fdc.c +++ b/src/fdc.c @@ -626,6 +626,8 @@ void fdc_implied_seek() } } +int fifo_count = 0; + void fdc_write(uint16_t addr, uint8_t val, void *priv) { int drive, i, drive_num; @@ -805,6 +807,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv) case 0x19: /*Scan low or equal*/ case 0x16: /*Verify*/ case 0x1D: /*Scan high or equal*/ + fifo_count = 0; fdc.satisfying_sectors=0; fdc.sc=0; fdc.wrong_am=0; @@ -1261,11 +1264,10 @@ uint8_t fdc_read(uint16_t addr, void *priv) { uint8_t temp; int drive; - fdc_log("Read FDC %04X\n",addr); switch (addr&7) { case 0: /* STA */ - return 0xff; + temp = 0xff; break; case 1: /* STB */ if (is486) @@ -1274,7 +1276,9 @@ uint8_t fdc_read(uint16_t addr, void *priv) } drive = real_drive(fdc.dor & 3); if (!fdc.enable_3f1) - return 0xff; + { + temp = 0xff; + } temp = 0x70; if (drive) temp &= ~0x40; @@ -1314,7 +1318,8 @@ uint8_t fdc_read(uint16_t addr, void *priv) case 4: /*Status*/ if (!(fdc.dor & 4) & !fdc.pcjr) { - return 0; + temp = 0; + break; } temp=fdc.stat; break; @@ -1373,6 +1378,7 @@ uint8_t fdc_read(uint16_t addr, void *priv) default: temp=0xFF; } + fdc_log("Read FDC %04X %02X\n",addr, temp); return temp; } @@ -1430,6 +1436,7 @@ void fdc_poll_common_finish(int compare, int st5) fdc.res[8]=fdc.head; fdc.res[9]=fdc.sector; fdc.res[10]=fdc.params[4]; + fdc_log("Read/write finish (%02X %02X %02X %02X %02X %02X %02X)\n" , fdc.res[4], fdc.res[5], fdc.res[6], fdc.res[7], fdc.res[8], fdc.res[9], fdc.res[10]); update_status_bar_icon(fdc.drive, 0); paramstogo=7; } @@ -1541,7 +1548,31 @@ void fdc_callback() old_sector = fdc.sector; if (fdc.tc) { - fdc.sector++; + /* This is needed so that the correct results are returned + in case of TC. */ + if (fdc.sector == fdc.params[5]) + { + if (!(fdc.command & 0x80)) + { + fdc.rw_track++; + fdc.sector = 1; + } + else + { + if (fdc.head) + { + fdc.rw_track++; + } + + fdc.head ^= 1; + fdd_set_head(fdc.drive, fdc.head); + fdc.sector = 1; + } + } + else + { + fdc.sector++; + } fdc_poll_readwrite_finish(compare); return; } @@ -1777,7 +1808,7 @@ void fdc_callback() fdc.config = fdc.params[1]; fdc.pretrk = fdc.params[2]; fdc.fifo = (fdc.params[1] & 0x20) ? 0 : 1; - fdc.tfifo = (fdc.params[1] & 0xF) + 1; + fdc.tfifo = (fdc.params[1] & 0xF); fdc.stat = 0x80; disctime = 0; return; @@ -1889,7 +1920,7 @@ int fdc_data(uint8_t data) return -1; } - if (fdc.pcjr || !fdc.fifo || (fdc.tfifo <= 1)) + if (fdc.pcjr || !fdc.fifo || (fdc.tfifo < 1)) { fdc.dat = data; fdc.data_ready = 1; @@ -1909,6 +1940,36 @@ int fdc_data(uint8_t data) } else { + if (fdc.tc) + { + fdc_log("FDC read: TC\n"); + return 0; + } + + if (dma_channel_write(2, data) & DMA_OVER) + { + fdc_log("FDC read: DMA over\n"); + fdc.tc = 1; + } + + if (!fdc.fifo) + { + fdc.data_ready = 1; + fdc.stat = 0xd0; + } + else + { + fdc_fifo_buf_advance(); + if (fdc.fifobufpos == 0) + { + /* We have wrapped around, means FIFO is over */ + fifo_count++; + fdc_log("%04X: FIFO wrap around (threshold == %02X), DRQ sent\n", fifo_count, fdc.tfifo); + fdc.data_ready = 1; + fdc.stat = 0xd0; + } + } +#if 0 result = dma_channel_write(2, data); if (fdc.tc) @@ -1922,7 +1983,7 @@ int fdc_data(uint8_t data) return -1; } - if (!fdc.fifo || (fdc.tfifo <= 1)) + if (!fdc.fifo || (fdc.tfifo < 1)) { fdc.data_ready = 1; fdc.stat = 0xd0; @@ -1937,6 +1998,7 @@ int fdc_data(uint8_t data) fdc.stat = 0xd0; } } +#endif } return 0; diff --git a/src/net_ne2000.c b/src/net_ne2000.c index 9ea48215c..b0262dafc 100644 --- a/src/net_ne2000.c +++ b/src/net_ne2000.c @@ -1809,7 +1809,7 @@ nic_init(int board) mac = device_get_config_int_ex("mac", -1); /* Set up our MAC address. */ -#if 0 +#if 1 if (dev->is_rtl8029as) { dev->maclocal[0] = 0xDE /* 0x00 */; /* 00:20:18 (RTL 8029AS PCI vendor prefix). */ dev->maclocal[1] = 0x20; diff --git a/src/net_pcap.c b/src/net_pcap.c index 1a7eef1fa..d765e93c6 100644 --- a/src/net_pcap.c +++ b/src/net_pcap.c @@ -141,7 +141,7 @@ network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) pcap = pcap_open_live(dev, /* interface name */ 1518, /* maximum packet size */ 1, /* promiscuous mode? */ - 10, /* timeout in msec */ + 15, /* timeout in msec */ temp); /* error buffer */ if (pcap == NULL) { pclog("Unable to open WinPcap: %s!\n", temp); From e8d047d0d0c6ec50e327897deb86b38d724129cf Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 21 May 2017 03:52:18 +0200 Subject: [PATCH 4/5] The icons and status bar handling code for the SCSI removable hard disks is now there. --- src/ICONS/hard_disk_removable_scsi.ico | Bin 0 -> 1150 bytes src/ICONS/hard_disk_removable_scsi_active.ico | Bin 0 -> 1150 bytes src/ICONS/hard_disk_removable_scsi_empty.ico | Bin 0 -> 1150 bytes .../hard_disk_removable_scsi_empty_active.ico | Bin 0 -> 1150 bytes src/WIN/86Box.rc | 8 ++++- src/WIN/win.c | 29 +++++++++++------- 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 src/ICONS/hard_disk_removable_scsi.ico create mode 100644 src/ICONS/hard_disk_removable_scsi_active.ico create mode 100644 src/ICONS/hard_disk_removable_scsi_empty.ico create mode 100644 src/ICONS/hard_disk_removable_scsi_empty_active.ico diff --git a/src/ICONS/hard_disk_removable_scsi.ico b/src/ICONS/hard_disk_removable_scsi.ico new file mode 100644 index 0000000000000000000000000000000000000000..59f80a96b3fd5aedcc1df78d25bed544c4c0381b GIT binary patch literal 1150 zcmZQzU}Ruq5D);-3Je)63=Con3=A3!3=9Gc3=9ek5OD?&U}0c5Ci^Z*)Bm4nssDF%@%(=veK(gZ1dCmnIrabL>68Co znmY0S#mW8uFHGqDf4;Bl|M{Md|L3~e{-5n=`G2mr1FZH$YvaG$8`k~#aQoJO1itzI z{Vfo_@&EnJ8~@+mxc>j$^=tp%UAy}K-POzg-(I=&|Lx_A|KD7?@c+ufdH*iWn{)Eo zg1P^%%$fQB%A6SxJZt*@%QL6`zcgdY|4U%EO!|Kj=AKD?|1V7J1>+Mf^=G!HC1u=Q zw;JN!iM{{N_jdk2+u8d6bZg`PlZ`e1Pt;cYKUP`t|43=U|3ig2{}1J7fiXyKLuf$8 ze0zI=YfBb>yABH9xwHO*{C{c6g#YLJyTSeio6}J9|9DOL|D)wa|Bn>sf$_1rsxON@ z%=kcQ@KkTtvOB9+{0ErG+qQt?`1<_W|F6!P_W#nfN&hcQ==p!Hr{n*bwx<85nrh*GIos3me}$`q zHApWA*E29MU7kPZ;f;m!z;3vP#~&cOPqsH*1?fY^dkS-kuPs>!N>Bf;AhvAvy(F??AHu|7TzTVM1)*qk>vl0a}#}zHPxNJG<(M1i?gQvy)a|S z-}BQZ{XIWr!rya~`u?8n@A-SCxASk_iab=kP;)XDrv16HVD7(%TQ~iGuzAD(dmGpN zzq@|T|2u0|{=c(o`TtwXm;ArEbkYChZOQ+WpVnfUu`T)k)rIr^J>0hW|AVcY{y*Hl z1x(*ZGplHA(f{NJ<^PlKm7{0EUz$4c z|HaAu|1V7F{l9KX-G8wEZxtZ)A4&edvZwst?G5Yxe7JqHja!ocjOLj4A&wf!#9c|3#R4CiVTlFtHbmPqfsZ*`Ah^ad+Knh;KcOjsH(J*8D$FTk-!`Wy${|r3L>F73Taul%EC0Ah`{p0U7h{?FFtaS@`Yxg1P^% z&7B4I|D`Dt{-5vf{(r8k4Ps71&Hv*y<^PYC7yUm{oCn6o>Z-mh_AuiErJ+;3UCZvQ zUhyAf#??79z~OgsQXj-E9WDP)H`o6^QD61{SXC+59VhB4|L-f#n-9_p!mB*pTpw)P z^8dzyx&N=vpZ)*ptZDx*O`G)p!i1jx=XyH+pJ{9Qf2ye#?w7MY9sgIjI#`4Bf^a

6P-|Y#}Dad*UlKuZ61H=CY!Y*iFWMBYeW(I}>%nS_w H|3feUz^f{N literal 0 HcmV?d00001 diff --git a/src/ICONS/hard_disk_removable_scsi_empty.ico b/src/ICONS/hard_disk_removable_scsi_empty.ico new file mode 100644 index 0000000000000000000000000000000000000000..be5da8ee4a94b4bb6005429db3d1ab80fc52d914 GIT binary patch literal 1150 zcmZQzU}Ruq5D);-3Je)63=Con3=A3!3=9Gc3=9ek5OD?&U}0c5CbY`}+LZzpu}o`TP3p>A$beocjCf)XBduPagmK^2D*fFODDm`{L-~zt4{x z`uqIwfxpiW@BjN~+vbyRuUz`~`QF|CpYGoI|MAZ4{~vGP`v2k9jsG8RUjP5$`nCV> zuU-BB{_5rb@2_0?|L*dI|8Fmz|NjomzWD$7;RFBPUb+15^ZmR3Ki#|g|MUHOU>d7g zH?IBvaQ*84_t&oc|8VOj*qrA_4*q+46{Pb+Y9IZzd3*Q|C@8C|Gz$a>i_H0 zC;z`bb^QP9lgIwQI)3#3t7Aw0zdCsgqW|cje;@AL{`2$0hyMut{{N2;Q2hS={~zz) z{r~X}gx~)E@%9Y_zj^)t` z)9I7{pC37R=KjWY86R)ogt!;v)|1DAg!(uMzTE}Z}W`uy4d zug{+T|LXL~|1VD+|NrXLiNE*Pu1rDJJCN-E{}~uSn2;M97#SGAn3;j$05e1nNFM;l CWq%d` literal 0 HcmV?d00001 diff --git a/src/ICONS/hard_disk_removable_scsi_empty_active.ico b/src/ICONS/hard_disk_removable_scsi_empty_active.ico new file mode 100644 index 0000000000000000000000000000000000000000..8c08338ba50069a50b687c7cae2133063b3438f7 GIT binary patch literal 1150 zcmZQzU}Ruq5D);-3Je)63=Con3=A3!3=9Gc3=9ek5OD?&U}0c5C)*qk>vl0a}#}@9X@dW&BgP7Utc))_x1U+ ze_x+F^Y``H(|=!`IraC|sgr+So;?0HZ$%!eUZ^?QOEUkwy>jW_=X-bmf4Y0;|HnJG z|9`xF>;H#aH~xRPdHw%~>(~CjzjpP1^0wsv$xmxB&DfUw|Lv8_|32Tp`~TCuyZ=Am zzXzt#%_>@3^gsDQ`Tyj5r6^|PEY11<_9{sKz5nm8UHSj^;`#q?FP!`T=KR_JZ_b_m z|N88y|F2J<{C{ZQ%Ku>h-zq@pKa%`^|IVfVKHRze=jVqH{}K58{~sTq`2G9;Ki^3>yyX-zdC;O|I4F?{=Yc1|Nrv?d;dS% zyX*h6-P`{^-Ldum)9stV7$kRR$%2f_lO_qgyLROp$PMoAK3hM@3!4RR;QEys@he|h-e|K|ty z{eQM^H`pB@H$C3DZ9YgZ2;ZDN!}Zhsd;i~Gx%B_t<%dvNcFA2p?o%V0v@;;=}h>E`!~G*B=M={(o`o@KumLWc+By*5Y^9uKas@ zcrpsYgeWq>m5k;|APz+ Z{~HLqpn;Kr0gRa$7!EKqF#P`y!2nP6d))v4 literal 0 HcmV?d00001 diff --git a/src/WIN/86Box.rc b/src/WIN/86Box.rc index a593212e4..7c8395647 100644 --- a/src/WIN/86Box.rc +++ b/src/WIN/86Box.rc @@ -664,6 +664,8 @@ END 163 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_active.ico" 164 ICON DISCARDABLE "ICONS/cdrom_scsi.ico" 165 ICON DISCARDABLE "ICONS/cdrom_scsi_active.ico" +176 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi.ico" +177 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_active.ico" 192 ICON DISCARDABLE "ICONS/hard_disk_mfm.ico" 193 ICON DISCARDABLE "ICONS/hard_disk_mfm_active.ico" 194 ICON DISCARDABLE "ICONS/hard_disk.ico" @@ -702,6 +704,8 @@ END 419 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_empty_active.ico" 420 ICON DISCARDABLE "ICONS/cdrom_scsi_empty.ico" 421 ICON DISCARDABLE "ICONS/cdrom_scsi_empty_active.ico" +432 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_empty.ico" +433 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_empty_active.ico" 512 ICON DISCARDABLE "ICONS/floppy_disabled.ico" 514 ICON DISCARDABLE "ICONS/cdrom_disabled.ico" @@ -1003,7 +1007,9 @@ BEGIN 2198 "Removable disk %i: %s" 2199 "USB is not yet supported" 2200 "Invalid PCap device" - 2201 "English (United States)" + 2201 "SCSI removable disk: %ws" + 2202 "" + 2203 "English (United States)" END diff --git a/src/WIN/win.c b/src/WIN/win.c index 010b67f61..af72b0ef1 100644 --- a/src/WIN/win.c +++ b/src/WIN/win.c @@ -809,6 +809,23 @@ void create_cdrom_tip(int part) } } +void create_removable_hd_tip(int part) +{ + WCHAR *szText; + WCHAR wtext[512]; + + int drive = sb_part_meanings[part] & 0xf; + + if (wcslen(hdd_fn[drive]) == 0) + { + _swprintf(sbTips[part], win_language_get_string_from_id(2201), win_language_get_string_from_id(2185)); + } + else + { + _swprintf(sbTips[part], win_language_get_string_from_id(2179), hdd_fn[drive]); + } +} + void create_hd_tip(int part) { WCHAR *szText; @@ -841,11 +858,9 @@ void update_tip(int meaning) case 0x10: create_cdrom_tip(part); break; -#if 0 case 0x20: create_removable_hd_tip(part); break; -#endif case 0x30: create_hd_tip(part); break; @@ -954,7 +969,6 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } -#if 0 for (i = 0; i < 16; i++) { if (hdc[i].bus == 5) @@ -965,7 +979,6 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } -#endif if (c_mfm && !(models[model].flags & MODEL_HAS_IDE) && !!memcmp(hdd_controller_name, "none", 4) && !!memcmp(hdd_controller_name, "xtide", 5)) { edge += sb_icon_width; @@ -1047,14 +1060,12 @@ void update_status_bar_panes(HWND hwnds) sb_part_icons[i] = j | sb_icon_flags[i]; create_cdrom_tip(i); break; -#if 0 case 0x20: /* Removable hard disk */ sb_icon_flags[i] = (wcslen(discfns[sb_part_meanings[i] & 0xf]) == 0) ? 256 : 0; sb_part_icons[i] = 176 + sb_icon_flags[i]; - create_floppy_tip(i); + create_removable_hd_tip(i); break; -#endif case 0x30: /* Hard disk */ sb_part_icons[i] = 192 + ((sb_part_meanings[i] & 0xf) << 1); @@ -1107,12 +1118,10 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst) hIcon[i] = LoadIconEx((PCTSTR) i); } -#if 0 for (i = 176; i < 178; i++) { hIcon[i] = LoadIconEx((PCTSTR) i); } -#endif for (i = 192; i < 200; i++) { @@ -1139,12 +1148,10 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst) hIcon[i] = LoadIconEx((PCTSTR) i); } -#if 0 for (i = 432; i < 434; i++) { hIcon[i] = LoadIconEx((PCTSTR) i); } -#endif GetWindowRect(hwndParent, &rectDialog); dw = rectDialog.right - rectDialog.left; From bf47a5493a14812be446526c6e7d3e63960e0b20 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 21 May 2017 04:39:21 +0200 Subject: [PATCH 5/5] The WinPcap handler no longer forces non-blocking mode, DHCP still works with Win10Pcap. --- src/net_pcap.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/net_pcap.c b/src/net_pcap.c index d765e93c6..68fafb6d2 100644 --- a/src/net_pcap.c +++ b/src/net_pcap.c @@ -148,43 +148,6 @@ network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) return(-1); } - /* Time to check that we are in non-blocking mode. */ - rc=pcap_getnonblock(pcap,temp); - pclog("pcap is currently in %s mode\n",rc? "non-blocking":"blocking"); - - switch(rc) - { - case 0: - pclog("Setting interface to non-blocking mode.."); - rc = pcap_setnonblock(pcap,1,temp); - if (rc==0) - { /* no errors! */ - pclog(".."); - rc=pcap_getnonblock(pcap,temp); - if(rc == 1) - { - pclog("..!",rc); - } - else - { - pclog("\tunable to set pcap into non-blocking mode!\nContinuining without pcap.\n"); - return(-1); - } - } /* end set nonblock */ - else - { - pclog("There was an unexpected error of [%s]\n\nexiting.\n",temp);return(-1);} - pclog("\n"); - break; - case 1: - pclog("non blocking\n"); - break; - default: - pclog("this isn't right!!!\n"); - return(-1); - break; - } - /* Create a MAC address based packet filter. */ pclog("Building packet filter ..."); sprintf(filter_exp,