aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/smc
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2011-09-02 20:35:22 +0000
committerStanislav Sedov <stas@FreeBSD.org>2011-09-02 20:35:22 +0000
commitbd2369f62e1e4faf1abe84d9cbae26bd42b78969 (patch)
tree381fadb631d103e5091f21013325ebfba889d95b /sys/dev/smc
parent871ffe942def6dba2ac7310fb481615b97c3849c (diff)
Notes
Diffstat (limited to 'sys/dev/smc')
-rw-r--r--sys/dev/smc/if_smc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/smc/if_smc.c b/sys/dev/smc/if_smc.c
index 22f8bab9e822b..4aa0396fbe88c 100644
--- a/sys/dev/smc/if_smc.c
+++ b/sys/dev/smc/if_smc.c
@@ -538,6 +538,7 @@ smc_task_tx(void *context, int pending)
struct smc_softc *sc;
struct mbuf *m, *m0;
u_int packet, len;
+ int last_len;
uint8_t *data;
(void)pending;
@@ -590,16 +591,18 @@ smc_task_tx(void *context, int pending)
* Push the data out to the device.
*/
data = NULL;
+ last_len = 0;
for (; m != NULL; m = m->m_next) {
data = mtod(m, uint8_t *);
smc_write_multi_2(sc, DATA0, (uint16_t *)data, m->m_len / 2);
+ last_len = m->m_len;
}
/*
* Push out the control byte and and the odd byte if needed.
*/
if ((len & 1) != 0 && data != NULL)
- smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[m->m_len - 1]);
+ smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[last_len - 1]);
else
smc_write_2(sc, DATA0, 0);