summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2001-03-23 17:46:32 +0000
committerarchie <archie@FreeBSD.org>2001-03-23 17:46:32 +0000
commite22250630ad78bc0b2b6b8f7b7eef84c54dcc10a (patch)
tree75387b05898e37c7b414544f362d97b5c48df04b /sys/dev/an
parent6088152946b12c2ce82b70f305fe944677a6cf41 (diff)
downloadFreeBSD-src-e22250630ad78bc0b2b6b8f7b7eef84c54dcc10a.zip
FreeBSD-src-e22250630ad78bc0b2b6b8f7b7eef84c54dcc10a.tar.gz
A few fixes..
1 Make promiscuous mode work 2 A few header additions 3 Allow device config before IFF_UP These were (respectively)... Submitted by: Allan Saddi <asaddi@philosophysw.com> Submitted by: Dave Cornejo <dave@dogwood.com> Submitted by: Doug Ambrisko <ambrisko@ambrisko.com> Tested by: David Wolfskill <dhw@whistle.com>
Diffstat (limited to 'sys/dev/an')
-rw-r--r--sys/dev/an/if_aironet_ieee.h5
-rw-r--r--sys/dev/an/if_an.c43
-rw-r--r--sys/dev/an/if_anreg.h6
3 files changed, 15 insertions, 39 deletions
diff --git a/sys/dev/an/if_aironet_ieee.h b/sys/dev/an/if_aironet_ieee.h
index 53c294e..bcbd32f 100644
--- a/sys/dev/an/if_aironet_ieee.h
+++ b/sys/dev/an/if_aironet_ieee.h
@@ -392,6 +392,9 @@ struct an_ltv_genconfig {
#define AN_TXPOWER_100MW 100
#define AN_TXPOWER_250MW 250
+#define AN_HOME_NETWORK 0x0001
+#define AN_HOME_INSTALL_AP 0x0002
+
struct an_ltv_ssidlist {
u_int16_t an_len;
u_int16_t an_type;
@@ -523,7 +526,7 @@ struct an_ltv_status {
u_int16_t an_max_noise_prev_sec; /* 0x7A */
u_int16_t an_avg_noise_prev_min; /* 0x7C */
u_int16_t an_max_noise_prev_min; /* 0x7E */
- u_int16_t an_spare[2];
+ u_int16_t an_spare[3];
};
#define AN_STATUS_OPMODE_CONFIGURED 0x0001
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index 6992957..2b38284 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -570,13 +570,6 @@ void an_intr(xsc)
ifp = &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);
- AN_UNLOCK(sc);
- return;
- }
-
/* Disable interrupts. */
CSR_WRITE_2(sc, AN_INT_EN, 0);
@@ -616,7 +609,7 @@ void an_intr(xsc)
/* Re-enable interrupts. */
CSR_WRITE_2(sc, AN_INT_EN, AN_INTRS);
- if (ifp->if_snd.ifq_head != NULL)
+ if ((ifp->if_flags & IFF_UP) && (ifp->if_snd.ifq_head != NULL))
an_start(ifp);
AN_UNLOCK(sc);
@@ -962,7 +955,7 @@ static void an_setdef(sc, areq)
/* Reinitialize the card. */
- if (ifp->if_flags & IFF_UP)
+ if (ifp->if_flags)
an_init(sc);
return;
@@ -977,31 +970,7 @@ static void an_promisc(sc, promisc)
struct an_softc *sc;
int promisc;
{
- /* 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;
- /* kills card DJA, if in sniff mode can't TX packets
- 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 */
- sc->an_config.an_len = sizeof(struct an_ltv_genconfig);
- sc->an_config.an_type = AN_RID_GENCONFIG;
- if (an_write_record(sc, (struct an_ltv_gen *)&sc->an_config)) {
- printf("an%d: failed to set configuration\n", sc->an_unit);
- return;
- }
- /* Turn the MAC back on. */
- an_cmd(sc, AN_CMD_ENABLE, 0);
+ an_cmd(sc, AN_CMD_SET_MODE, promisc ? 0xffff : 0);
return;
}
@@ -1206,6 +1175,9 @@ static void an_init(xsc)
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);
@@ -1286,9 +1258,6 @@ static void an_start(ifp)
m_freem(m0);
m0 = NULL;
- /* TX START disable lan monitor ? DJA
- an_disable_sniff():
- */
sc->an_rdata.an_tx_ring[idx] = id;
if (an_cmd(sc, AN_CMD_TX, id))
printf("an%d: xmit failed\n", sc->an_unit);
diff --git a/sys/dev/an/if_anreg.h b/sys/dev/an/if_anreg.h
index 241cd65..844d480 100644
--- a/sys/dev/an/if_anreg.h
+++ b/sys/dev/an/if_anreg.h
@@ -92,6 +92,7 @@
#define AN_CMD_HOST_SLEEP 0x0005
#define AN_CMD_MAGIC_PKT 0x0006
#define AN_CMD_READCFG 0x0008
+#define AN_CMD_SET_MODE 0x0009
#define AN_CMD_ALLOC_MEM 0x000A /* allocate NIC memory */
#define AN_CMD_TX 0x000B /* transmit */
#define AN_CMD_DEALLOC_MEM 0x000C
@@ -343,6 +344,9 @@ struct an_ltv_genconfig {
#define AN_TXPOWER_100MW 100
#define AN_TXPOWER_250MW 250
+#define AN_HOME_NETWORK 0x0001
+#define AN_HOME_INSTALL_AP 0x0002
+
/*
* Valid SSID list. You can specify up to three SSIDs denoting
* the service sets that you want to join. The first SSID always
@@ -528,7 +532,7 @@ struct an_ltv_status {
u_int16_t an_max_noise_prev_sec; /* 0x7A */
u_int16_t an_avg_noise_prev_min; /* 0x7C */
u_int16_t an_max_noise_prev_min; /* 0x7E */
- u_int16_t an_spare[2];
+ u_int16_t an_spare[3];
};
#define AN_STATUS_OPMODE_CONFIGURED 0x0001
OpenPOWER on IntegriCloud