PDP11, VAX780: Fix DEUNA handling of incoming packets which are dropped into multiple receive buffers.
Make sure to properly support multiple receive buffers by correctly setting the data length read and the appropriate buffer descriptor status bits for each buffer descriptor that is used to hold a packet.
This commit is contained in:
parent
ea5b1dc6fe
commit
368a5f6998
1 changed files with 31 additions and 29 deletions
|
@ -1182,7 +1182,7 @@ int32 xu_command(CTLR* xu)
|
||||||
void xu_process_receive(CTLR* xu)
|
void xu_process_receive(CTLR* xu)
|
||||||
{
|
{
|
||||||
uint32 segb, ba;
|
uint32 segb, ba;
|
||||||
int slen, wlen, off = 0;
|
int slen, wlen;
|
||||||
t_stat rstatus, wstatus;
|
t_stat rstatus, wstatus;
|
||||||
ETH_ITEM* item = 0;
|
ETH_ITEM* item = 0;
|
||||||
int state = xu->var->pcsr1 & PCSR1_STATE;
|
int state = xu->var->pcsr1 & PCSR1_STATE;
|
||||||
|
@ -1226,6 +1226,9 @@ void xu_process_receive(CTLR* xu)
|
||||||
slen = xu->var->rxhdr[0];
|
slen = xu->var->rxhdr[0];
|
||||||
segb = xu->var->rxhdr[1] + ((xu->var->rxhdr[2] & 3) << 16);
|
segb = xu->var->rxhdr[1] + ((xu->var->rxhdr[2] & 3) << 16);
|
||||||
|
|
||||||
|
/* Initially clear status bits which are conditionally set below */
|
||||||
|
xu->var->rxhdr[2] &= ~(RXR_FRAM|RXR_OFLO|RXR_CRC|RXR_STF|RXR_ENF);
|
||||||
|
|
||||||
/* get first packet from receive queue */
|
/* get first packet from receive queue */
|
||||||
if (!item) {
|
if (!item) {
|
||||||
item = &xu->var->ReadQ.item[xu->var->ReadQ.head];
|
item = &xu->var->ReadQ.item[xu->var->ReadQ.head];
|
||||||
|
@ -1254,10 +1257,8 @@ void xu_process_receive(CTLR* xu)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is this the start of frame? */
|
/* is this the start of frame? */
|
||||||
if (item->packet.used == 0) {
|
if (item->packet.used == 0)
|
||||||
xu->var->rxhdr[2] |= RXR_STF;
|
xu->var->rxhdr[2] |= RXR_STF;
|
||||||
off = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* figure out chained packet size */
|
/* figure out chained packet size */
|
||||||
wlen = item->packet.crc_len - item->packet.used;
|
wlen = item->packet.crc_len - item->packet.used;
|
||||||
|
@ -1265,7 +1266,7 @@ void xu_process_receive(CTLR* xu)
|
||||||
wlen = slen;
|
wlen = slen;
|
||||||
|
|
||||||
/* transfer chained packet to host buffer */
|
/* transfer chained packet to host buffer */
|
||||||
wstatus = Map_WriteB (segb, wlen, &item->packet.msg[off]);
|
wstatus = Map_WriteB (segb, wlen, &item->packet.msg[item->packet.used]);
|
||||||
if (wstatus) {
|
if (wstatus) {
|
||||||
/* error during write */
|
/* error during write */
|
||||||
xu->var->stat |= STAT_ERRS | STAT_MERR | STAT_TMOT | STAT_RRNG;
|
xu->var->stat |= STAT_ERRS | STAT_MERR | STAT_TMOT | STAT_RRNG;
|
||||||
|
@ -1275,12 +1276,6 @@ void xu_process_receive(CTLR* xu)
|
||||||
|
|
||||||
/* update chained counts */
|
/* update chained counts */
|
||||||
item->packet.used += wlen;
|
item->packet.used += wlen;
|
||||||
off += wlen;
|
|
||||||
|
|
||||||
/* Is this the end-of-frame? */
|
|
||||||
if (item->packet.used == item->packet.crc_len) {
|
|
||||||
/* mark end-of-frame */
|
|
||||||
xu->var->rxhdr[2] |= RXR_ENF;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in the Received Message Length field.
|
* Fill in the Received Message Length field.
|
||||||
|
@ -1302,7 +1297,14 @@ void xu_process_receive(CTLR* xu)
|
||||||
* part of the packet, and is included in the MLEN count. -- DTH
|
* part of the packet, and is included in the MLEN count. -- DTH
|
||||||
*/
|
*/
|
||||||
xu->var->rxhdr[3] &= ~RXR_MLEN;
|
xu->var->rxhdr[3] &= ~RXR_MLEN;
|
||||||
xu->var->rxhdr[3] |= (item->packet.crc_len);
|
xu->var->rxhdr[3] |= wlen;
|
||||||
|
|
||||||
|
/* Is this the end-of-frame? OR is buffer chaining disabled? */
|
||||||
|
if ((item->packet.used == item->packet.crc_len) ||
|
||||||
|
(xu->var->mode & MODE_DRDC)) {
|
||||||
|
/* mark end-of-frame */
|
||||||
|
xu->var->rxhdr[2] |= RXR_ENF;
|
||||||
|
|
||||||
if (xu->var->mode & MODE_DRDC) /* data chaining disabled */
|
if (xu->var->mode & MODE_DRDC) /* data chaining disabled */
|
||||||
xu->var->rxhdr[3] |= RXR_NCHN;
|
xu->var->rxhdr[3] |= RXR_NCHN;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue