Revision 22ed1d34 hw/smc91c111.c

b/hw/smc91c111.c
160 160
    int i;
161 161
    int len;
162 162
    int control;
163
    int add_crc;
164 163
    int packetnum;
165 164
    uint8_t *p;
166 165

  
......
187 186
            len = 64;
188 187
        }
189 188
#if 0
190
        /* The card is supposed to append the CRC to the frame.  However
191
           none of the other network traffic has the CRC appended.
192
           Suspect this is low level ethernet detail we don't need to worry
193
           about.  */
194
        add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
195
        if (add_crc) {
196
            uint32_t crc;
197

  
198
            crc = crc32(~0, p, len);
199
            memcpy(p + len, &crc, 4);
200
            len += 4;
189
        {
190
            int add_crc;
191

  
192
            /* The card is supposed to append the CRC to the frame.
193
               However none of the other network traffic has the CRC
194
               appended.  Suspect this is low level ethernet detail we
195
               don't need to worry about.  */
196
            add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
197
            if (add_crc) {
198
                uint32_t crc;
199

  
200
                crc = crc32(~0, p, len);
201
                memcpy(p + len, &crc, 4);
202
                len += 4;
203
            }
201 204
        }
202
#else
203
        add_crc = 0;
204 205
#endif
205 206
        if (s->ctr & CTR_AUTO_RELEASE)
206 207
            /* Race?  */
......
670 671
        *(p++) = crc & 0xff; crc >>= 8;
671 672
        *(p++) = crc & 0xff; crc >>= 8;
672 673
        *(p++) = crc & 0xff; crc >>= 8;
673
        *(p++) = crc & 0xff; crc >>= 8;
674
        *(p++) = crc & 0xff;
674 675
    }
675 676
    if (size & 1) {
676 677
        *(p++) = buf[size - 1];
677
        *(p++) = 0x60;
678
        *p = 0x60;
678 679
    } else {
679 680
        *(p++) = 0;
680
        *(p++) = 0x40;
681
        *p = 0x40;
681 682
    }
682 683
    /* TODO: Raise early RX interrupt?  */
683 684
    s->int_level |= INT_RCV;

Also available in: Unified diff