Hello -
This patch is taken from FreeBSD.
It fixes promiscuous mode on the an driver.
I have indeed tested this patched an verified it does work.
Thanks
- David
### PATCH ###
- /sys/dev/ic/an.c.orig Wed Apr 2 15:22:26 2003
+++ /sys/dev/ic/an.c Wed Apr 2 15:27:01 2003
@@ -474,12 +474,6 @@
ifp = &sc->sc_arpcom.ac_if;
- if (!(ifp->if_flags & IFF_UP)) {
- CSR_WRITE_2(sc, AN_EVENT_ACK, 0xFFFF);
- CSR_WRITE_2(sc, AN_INT_EN, 0);
- return 0;
- }
-
/* Disable interrupts. */
CSR_WRITE_2(sc, AN_INT_EN, 0);
@@ -519,7 +513,7 @@
/* Re-enable interrupts. */
CSR_WRITE_2(sc, AN_INT_EN, AN_INTRS);
- if (!IFQ_IS_EMPTY(&ifp->if_snd))
+ if ((ifp->if_flags & IFF_UP) && (!IFQ_IS_EMPTY(&ifp->if_snd)))
an_start(ifp);
return 1;
@@ -941,7 +935,7 @@
}
/* Reinitialize the card. */
- if (ifp->if_flags & IFF_UP)
+ if (ifp->if_flags)
an_init(sc);
}
@@ -955,32 +949,7 @@
struct an_softc *sc;
int promisc;
{
- struct an_ltv_genconfig genconf;
-
- /* Disable the MAC. */
- an_cmd(sc, AN_CMD_DISABLE, 0);
-
- /* Set RX mode. */
- if (promisc &&
- !(sc->an_config.an_rxmode & AN_RXMODE_LAN_MONITOR_CURBSS) ) {
- sc->an_rxmode = sc->an_config.an_rxmode;
- sc->an_config.an_rxmode |=
- AN_RXMODE_LAN_MONITOR_CURBSS;
- } else {
- sc->an_config.an_rxmode = sc->an_rxmode;
- }
-
- /* Transfer the configuration to the NIC */
- genconf = sc->an_config;
- genconf.an_len = sizeof(struct an_ltv_genconfig);
- genconf.an_type = AN_RID_GENCONFIG;
- if (an_write_record(sc, (struct an_ltv_gen *)&genconf)) {
- printf("%s: failed to set configuration\n",
- sc->sc_dev.dv_xname);
- return;
- }
- /* Turn the MAC back on. */
- an_cmd(sc, AN_CMD_ENABLE, 0);
+ an_cmd(sc, AN_CMD_SET_MODE, promisc ? 0xffff : 0);
}
int
@@ -1210,6 +1179,9 @@
return;
}
+ if (ifp->if_flags & IFF_PROMISC)
+ an_cmd(sc, AN_CMD_SET_MODE, 0xffff);
+
/* enable interrupts */
CSR_WRITE_2(sc, AN_INT_EN, AN_INTRS);
Received on Wed Apr 2 15:56:59 2003
This archive was generated by hypermail 2.1.8
: Wed Aug 23 2006 - 13:29:53 EDT
|