summaryrefslogtreecommitdiffstats
path: root/sys/dev/ti/if_tireg.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-07-23 18:46:24 +0000
committerwpaul <wpaul@FreeBSD.org>1999-07-23 18:46:24 +0000
commite4620300d62667d571e600e6ecb2f9612cd79c16 (patch)
treee0a4676a6116d6b756492d18b4d27db6412d766b /sys/dev/ti/if_tireg.h
parentb934da313fb54901baae33b34494eafd440c1904 (diff)
downloadFreeBSD-src-e4620300d62667d571e600e6ecb2f9612cd79c16.zip
FreeBSD-src-e4620300d62667d571e600e6ecb2f9612cd79c16.tar.gz
Clean up the buffer allocation code a bit. Make sure to initialize certain
critical mbuf fields to sane values. Simplify the use of ETHER_ALIGN to enforce payload alignment, and turn it on on the x86 as well as alpha since it helps with NFS which wants the payload to be longword aligned even though the hardware doesn't require it. This fixes a problem with the ti driver causing an unaligned access trap on the Alpha due to m_adj() sometimes not setting the alignment correctly because of incomplete mbuf initialization.
Diffstat (limited to 'sys/dev/ti/if_tireg.h')
-rw-r--r--sys/dev/ti/if_tireg.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/ti/if_tireg.h b/sys/dev/ti/if_tireg.h
index 95db390..65483a2 100644
--- a/sys/dev/ti/if_tireg.h
+++ b/sys/dev/ti/if_tireg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_tireg.h,v 1.6 1999/07/23 02:10:11 wpaul Exp $
+ * $Id: if_tireg.h,v 1.7 1999/07/23 02:17:59 wpaul Exp $
*/
/*
@@ -801,17 +801,10 @@ struct ti_tx_desc {
* boundary.
*/
-#ifdef __alpha__
#define ETHER_ALIGN 2
-#endif
-
-#ifdef __i386__
-#define ETHER_ALIGN 0
-#endif
-
#define TI_FRAMELEN 1518
-#define TI_JUMBO_FRAMELEN 9018 + ETHER_ALIGN
+#define TI_JUMBO_FRAMELEN 9018
#define TI_JUMBO_MTU (TI_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
#define TI_PAGE_SIZE PAGE_SIZE
#define TI_MIN_FRAMELEN 60
@@ -1035,7 +1028,7 @@ struct ti_event_desc {
#define TI_MSLOTS 256
#define TI_JSLOTS 256
-#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + sizeof(u_int64_t))
+#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN + sizeof(u_int64_t))
#define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \
(TI_JRAWLEN % sizeof(u_int64_t))))
#define TI_JPAGESZ PAGE_SIZE
OpenPOWER on IntegriCloud