Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2018 19:44:06 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r342370 - stable/12/sys/dev/fxp
Message-ID:  <201812221944.wBMJi6Ot050843@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sat Dec 22 19:44:06 2018
New Revision: 342370
URL: https://svnweb.freebsd.org/changeset/base/342370

Log:
  MFC r342214:
  Remove a use of a negative array index from fxp(4).

Modified:
  stable/12/sys/dev/fxp/if_fxp.c
  stable/12/sys/dev/fxp/if_fxpreg.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/12/sys/dev/fxp/if_fxp.c	Sat Dec 22 16:23:42 2018	(r342369)
+++ stable/12/sys/dev/fxp/if_fxp.c	Sat Dec 22 19:44:06 2018	(r342370)
@@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
 		cbp->tbd_number = nseg;
 	/* Configure TSO. */
 	if (m->m_pkthdr.csum_flags & CSUM_TSO) {
-		cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
+		cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
 		cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
 		cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
 		    FXP_IPCB_IP_CHECKSUM_ENABLE |

Modified: stable/12/sys/dev/fxp/if_fxpreg.h
==============================================================================
--- stable/12/sys/dev/fxp/if_fxpreg.h	Sat Dec 22 16:23:42 2018	(r342369)
+++ stable/12/sys/dev/fxp/if_fxpreg.h	Sat Dec 22 19:44:06 2018	(r342370)
@@ -281,10 +281,15 @@ struct fxp_cb_tx {
 	uint16_t cb_status;
 	uint16_t cb_command;
 	uint32_t link_addr;
-	uint32_t tbd_array_addr;
-	uint16_t byte_count;
-	uint8_t tx_threshold;
-	uint8_t tbd_number;
+	union {
+		struct {
+			uint32_t tbd_array_addr;
+			uint16_t byte_count;
+			uint8_t tx_threshold;
+			uint8_t tbd_number;
+		};
+		struct fxp_tbd tbdtso;
+	};
 
 	/*
 	 * The following structure isn't actually part of the TxCB,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812221944.wBMJi6Ot050843>