summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pcmcia/if_malo.c33
-rw-r--r--sys/dev/pcmcia/if_malovar.h9
2 files changed, 32 insertions, 10 deletions
diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c
index a4d252e665c..89ee75c5c85 100644
--- a/sys/dev/pcmcia/if_malo.c
+++ b/sys/dev/pcmcia/if_malo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_malo.c,v 1.22 2007/07/08 10:09:02 mglocker Exp $ */
+/* $OpenBSD: if_malo.c,v 1.23 2007/07/30 21:45:31 mglocker Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -256,10 +256,17 @@ malo_pcmcia_activate(struct device *dev, enum devact act)
uint8_t ap[] = { 0x00, 0x17, 0x9a, 0x44, 0xda, 0x83 };
uint8_t chan[] = { 0x01 };
uint8_t ssid[] = "nazgul";
-#endif
+
uint8_t ap[] = { 0x00, 0x15, 0xe9, 0xa4, 0x6e, 0xd1 };
uint8_t chan[] = { 0x04 };
uint8_t ssid[] = "foobar";
+#endif
+
+uint8_t ap[] = { 0x00, 0x04, 0x75, 0x88, 0xa5, 0xb4 };
+uint8_t chan[] = { 0x04 };
+uint8_t ssid[] = "foobar";
+
+uint8_t rates[] = { 0x01, 0x04, 0x82, 0x84, 0x0b, 0x16 };
void
cmalo_attach(void *arg)
@@ -637,7 +644,7 @@ cmalo_init(struct ifnet *ifp)
cmalo_cmd_set_snmp(sc, MALO_OID_SHORTRETRY);
cmalo_cmd_set_snmp(sc, MALO_OID_FRAGTRESH);
- //cmalo_cmd_set_assoc(sc);
+ cmalo_cmd_set_assoc(sc);
/* device up */
ifp->if_flags |= IFF_RUNNING;
@@ -1175,7 +1182,7 @@ cmalo_parse_elements(struct malo_softc *sc, void *buf, int size, int pos)
break;
case IEEE80211_ELEMID_RATES:
bcopy(buf + i, sc->sc_networks[pos].rates, len);
- DPRINTF(2, "rates\n", sc->sc_networks[pos].rates);
+ DPRINTF(2, "rates\n");
break;
case IEEE80211_ELEMID_DSPARMS:
sc->sc_networks[pos].channel = *(uint8_t *)(buf + i);
@@ -1444,6 +1451,7 @@ cmalo_cmd_set_assoc(struct malo_softc *sc)
struct malo_cmd_tlv_phy *body_phy;
struct malo_cmd_tlv_cf *body_cf;
struct malo_cmd_tlv_rates *body_rates;
+ struct malo_cmd_tlv_passeid *body_passeid;
uint16_t psize;
bzero(sc->sc_cmd, MALO_CMD_BUFFER_SIZE);
@@ -1455,7 +1463,7 @@ cmalo_cmd_set_assoc(struct malo_softc *sc)
body = (struct malo_cmd_body_assoc *)(hdr + 1);
bcopy(ap, body->peermac, ETHER_ADDR_LEN);
- body->capinfo = htole16(IEEE80211_CAPINFO_ESS);
+ body->capinfo = htole16(IEEE80211_CAPINFO_ESS);
body->listenintrv = htole16(10);
body_ssid = sc->sc_cmd + psize;
@@ -1473,16 +1481,23 @@ cmalo_cmd_set_assoc(struct malo_softc *sc)
body_cf = sc->sc_cmd + psize;
body_cf->type = htole16(MALO_TLV_TYPE_CF);
body_cf->size = htole16(0);
- psize += sizeof(*body_cf);
+ psize += (sizeof(*body_cf) - 1);
body_rates = sc->sc_cmd + psize;
body_rates->type = htole16(MALO_TLV_TYPE_RATES);
body_rates->size =
- htole16(ic->ic_sup_rates[IEEE80211_MODE_11G].rs_nrates);
- bcopy(ic->ic_sup_rates[IEEE80211_MODE_11G].rs_rates, body_rates->data,
- ic->ic_sup_rates[IEEE80211_MODE_11G].rs_nrates);
+ htole16(ic->ic_sup_rates[IEEE80211_MODE_11B].rs_nrates);
+ bcopy(ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates, body_rates->data,
+ ic->ic_sup_rates[IEEE80211_MODE_11B].rs_nrates);
psize += (sizeof(*body_rates) - 1) + body_rates->size;
+ /* hack to correct FW's wrong generated rates-element-id */
+ body_passeid = sc->sc_cmd + psize;
+ body_passeid->type = htole16(MALO_TLV_TYPE_PASSEID);
+ body_passeid->size = htole16(6);
+ bcopy(rates, body_passeid->data, 6);
+ psize += (sizeof(*body_passeid) - 1) + body_passeid->size;
+
hdr->size = htole16(psize - sizeof(*hdr));
/* process command request */
diff --git a/sys/dev/pcmcia/if_malovar.h b/sys/dev/pcmcia/if_malovar.h
index e80f161db04..afb1a740854 100644
--- a/sys/dev/pcmcia/if_malovar.h
+++ b/sys/dev/pcmcia/if_malovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_malovar.h,v 1.14 2007/07/08 10:09:03 mglocker Exp $ */
+/* $OpenBSD: if_malovar.h,v 1.15 2007/07/30 21:45:31 mglocker Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -191,6 +191,7 @@ struct malo_cmd_body_rate {
#define MALO_TLV_TYPE_80211D 0x0007
#define MALO_TLV_TYPE_CHANLIST 0x0101
#define MALO_TLV_TYPE_NUMPROBES 0x0102
+#define MALO_TLV_TYPE_PASSEID 0x010a
struct malo_cmd_tlv_ssid {
uint16_t type;
@@ -248,6 +249,12 @@ struct malo_cmd_tlv_numprobes {
uint16_t numprobes;
} __packed;
+struct malo_cmd_tlv_passeid {
+ uint16_t type;
+ uint16_t size;
+ uint8_t data[1];
+} __packed;
+
/* RX descriptor */
#define MALO_RX_STATUS_OK 0x0001
struct malo_rx_desc {