From c9da81e79ba6b68e19e92ca690acda27a1a62878 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 14 Oct 2005 22:59:39 +0000 Subject: no functional change here, just moving the stripping of the FCS into the SIS_RXBYTES() macro. As done in the FreeBSD sis driver. --- sys/dev/pci/if_sis.c | 9 ++------- sys/dev/pci/if_sisreg.h | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 8aff9fc5c93..622a0ae3032 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.53 2005/10/13 01:44:33 brad Exp $ */ +/* $OpenBSD: if_sis.c,v 1.54 2005/10/14 22:59:38 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -1358,12 +1358,7 @@ void sis_rxeof(sc) continue; } - /* - * No errors; receive the packet. Note, the chip - * includes the CRC with every packet. - */ - total_len -= ETHER_CRC_LEN; - + /* No errors; receive the packet. */ bus_dmamap_sync(sc->sc_dmat, cur_rx->map, 0, cur_rx->map->dm_mapsize, BUS_DMASYNC_POSTREAD); #ifndef __STRICT_ALIGNMENT diff --git a/sys/dev/pci/if_sisreg.h b/sys/dev/pci/if_sisreg.h index 46e17202835..b1edef8661d 100644 --- a/sys/dev/pci/if_sisreg.h +++ b/sys/dev/pci/if_sisreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sisreg.h,v 1.21 2005/05/22 05:40:52 brad Exp $ */ +/* $OpenBSD: if_sisreg.h,v 1.22 2005/10/14 22:59:38 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -331,7 +331,7 @@ struct sis_desc { #define SIS_LASTDESC(x) (!((x)->sis_ctl & SIS_CMDSTS_MORE))) #define SIS_OWNDESC(x) ((x)->sis_ctl & SIS_CMDSTS_OWN) #define SIS_INC(x, y) { if (++(x) == y) x=0 ; } -#define SIS_RXBYTES(x) ((x)->sis_ctl & SIS_CMDSTS_BUFLEN) +#define SIS_RXBYTES(x) (((x)->sis_ctl & SIS_CMDSTS_BUFLEN) - ETHER_CRC_LEN) #define SIS_RXSTAT_COLL 0x00010000 #define SIS_RXSTAT_LOOPBK 0x00020000 -- cgit v1.2.3