KA10: Removed PACK definition, add polling if async eth fails.
This commit is contained in:
parent
b3214fcb59
commit
7acb4554bb
2 changed files with 9 additions and 31 deletions
|
@ -198,21 +198,6 @@
|
|||
#define NIA_CNT_RS8 053 /* Reserved for ucode */
|
||||
#define NIA_CNT_LEN 054 /* # of counters */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define PACKED_BEGIN __pragma( pack(push, 1) )
|
||||
# define PACKED_END __pragma( pack(pop) )
|
||||
# define QEMU_PACKED
|
||||
#else
|
||||
# define PACKED_BEGIN
|
||||
#if defined(_WIN32)
|
||||
# define PACKED_END __attribute__((gcc_struct, packed))
|
||||
# define QEMU_PACKED __attribute__((gcc_struct, packed))
|
||||
#else
|
||||
# define PACKED_END __attribute__((packed))
|
||||
# define QEMU_PACKED __attribute__((packed))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef uint32 in_addr_T;
|
||||
|
||||
#define ETHTYPE_ARP 0x0806
|
||||
|
@ -352,6 +337,7 @@ struct nia_device {
|
|||
uint64 status; /* Status of device. */
|
||||
uint32 uver[4]; /* Version information */
|
||||
int r_pkt; /* Packet pending */
|
||||
int poll; /* Need to poll receiver */
|
||||
} nia_data;
|
||||
|
||||
|
||||
|
@ -1496,6 +1482,8 @@ t_stat nia_eth_srv(UNIT * uptr)
|
|||
struct nia_eth_hdr *hdr;
|
||||
uint16 type;
|
||||
|
||||
if (nia_data.poll)
|
||||
sim_clock_coschedule(uptr, 1000); /* continue poll */
|
||||
/* Check if we need to get a packet */
|
||||
while (nia_data.r_pkt == 0) {
|
||||
if (eth_read(&nia_data.etherface, &nia_data.rec_buff, NULL) <= 0)
|
||||
|
@ -1636,7 +1624,12 @@ t_stat nia_attach(UNIT* uptr, CONST char* cptr)
|
|||
|
||||
|
||||
/* Allow Asynchronous inbound packets */
|
||||
eth_set_async (&nia_data.etherface, 0);
|
||||
if (eth_set_async (&nia_data.etherface, 0) == SCPE_OK)
|
||||
nia_data.poll = 0;
|
||||
else {
|
||||
nia_data.poll = 1;
|
||||
sim_activate (&nia_unit[0], 100);
|
||||
}
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -130,21 +130,6 @@
|
|||
#define ILEN u6 /* Size of input buffer in bits */
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define PACKED_BEGIN __pragma( pack(push, 1) )
|
||||
# define PACKED_END __pragma( pack(pop) )
|
||||
# define QEMU_PACKED
|
||||
#else
|
||||
# define PACKED_BEGIN
|
||||
#if defined(_WIN32)
|
||||
# define PACKED_END __attribute__((gcc_struct, packed))
|
||||
# define QEMU_PACKED __attribute__((gcc_struct, packed))
|
||||
#else
|
||||
# define PACKED_END __attribute__((packed))
|
||||
# define QEMU_PACKED __attribute__((packed))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define IMP_ARPTAB_SIZE 64
|
||||
#define IMP_ARP_MAX_AGE 100
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue