summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2003-08-20 03:46:05 +0000
committerambrisko <ambrisko@FreeBSD.org>2003-08-20 03:46:05 +0000
commitfa13e39cc0a599ab89c270598fb7818852f9dea7 (patch)
treef4d8bc1e2bbc75109c7fc8ea56fb2b56ab4b89dd /sys/dev/an
parentd3697017695d7e18b62a96440c913ef9d6e5e978 (diff)
downloadFreeBSD-src-fa13e39cc0a599ab89c270598fb7818852f9dea7.zip
FreeBSD-src-fa13e39cc0a599ab89c270598fb7818852f9dea7.tar.gz
- Add support for Cisco latest firmware RID sizes that supports 25 SSIDs!
- Fix up TX speed changes. - Make mpi-350 cards sort-of work with new firmware. It RXs okay but TXs only work for about 14 packets then fails to get an interrupt. The TX watchdog fires. It has been reported that my hack for now doesn't break cards with the older firmware. It appears my card has lost the ability to RX or TX at all but other peoples cards work. I assume it got damaged in tansport. MFC: 1 week.
Diffstat (limited to 'sys/dev/an')
-rw-r--r--sys/dev/an/if_aironet_ieee.h21
-rw-r--r--sys/dev/an/if_an.c210
-rw-r--r--sys/dev/an/if_an_pci.c2
-rw-r--r--sys/dev/an/if_anreg.h26
4 files changed, 172 insertions, 87 deletions
diff --git a/sys/dev/an/if_aironet_ieee.h b/sys/dev/an/if_aironet_ieee.h
index 2a6e79e..c894593 100644
--- a/sys/dev/an/if_aironet_ieee.h
+++ b/sys/dev/an/if_aironet_ieee.h
@@ -63,7 +63,7 @@
* data, which is 240 words long, so 256 should be a safe
* value.
*/
-#define AN_MAX_DATALEN 512
+#define AN_MAX_DATALEN 4096
struct an_req {
u_int16_t an_len;
@@ -261,7 +261,7 @@ struct an_ltv_stats {
u_int32_t an_uptime_usecs; /* 0x178 */
u_int32_t an_uptime_secs; /* 0x17C */
u_int32_t an_lostsync_better_ap; /* 0x180 */
- u_int32_t an_rsvd[10];
+ u_int32_t an_rsvd[15];
};
/*
@@ -337,6 +337,7 @@ struct an_ltv_genconfig {
u_int8_t an_magic_packet_action; /* 0x98 */
u_int8_t an_magic_packet_ctl; /* 0x99 */
u_int16_t an_rsvd9;
+ u_int16_t an_spare[13];
};
#define AN_OPMODE_IBSS_ADHOC 0x0000
@@ -417,6 +418,18 @@ struct an_ltv_ssidlist {
char an_ssid3[32];
};
+struct an_ltv_ssid_entry{
+ u_int16_t an_len;
+ char an_ssid[32];
+};
+
+#define MAX_SSIDS 25
+struct an_ltv_ssidlist_new {
+ u_int16_t an_len;
+ u_int16_t an_type;
+ struct an_ltv_ssid_entry an_entry[MAX_SSIDS];
+};
+
/*
* Valid AP list.
*/
@@ -501,7 +514,7 @@ struct an_ltv_caps {
u_int16_t an_softcaps; /* 0x7C */
u_int16_t an_bootblockrev; /* 0x7E */
u_int16_t an_req_hw_support; /* 0x80 */
- u_int16_t an_unknown; /* 0x82 */
+ u_int16_t an_unknown[31]; /* 0x82 */
};
/*
@@ -580,7 +593,7 @@ struct an_ltv_status {
u_int8_t an_avg_noise_prev_min_db; /* 0x7D */
u_int8_t an_max_noise_prev_min_pc; /* 0x7E */
u_int8_t an_max_noise_prev_min_db; /* 0x7F */
- u_int16_t an_spare[5];
+ u_int16_t an_spare[8];
};
#define AN_STATUS_OPMODE_CONFIGURED 0x0001
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index e799986..f1f9848 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -313,7 +313,7 @@ an_probe(dev)
device_t dev;
{
struct an_softc *sc = device_get_softc(dev);
- struct an_ltv_ssidlist ssid;
+ struct an_ltv_ssidlist_new ssid;
int error;
bzero((char *)&ssid, sizeof(ssid));
@@ -339,11 +339,11 @@ an_probe(dev)
ssid.an_type = AN_RID_SSIDLIST;
/* Make sure interrupts are disabled. */
+ sc->mpi350 = 0;
CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0);
CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF);
an_reset(sc);
- /* No need for an_init_mpi350_desc since it will be done in attach */
if (an_cmd(sc, AN_CMD_READCFG, 0))
return(0);
@@ -352,7 +352,7 @@ an_probe(dev)
return(0);
/* See if the ssid matches what we expect ... but doesn't have to */
- if (strcmp(ssid.an_ssid1, AN_DEF_SSID))
+ if (strcmp(ssid.an_entry[0].an_ssid, AN_DEF_SSID))
return(0);
return(AN_IOSIZ);
@@ -715,7 +715,7 @@ an_attach(sc, unit, flags)
/* Read ssid list */
sc->an_ssidlist.an_type = AN_RID_SSIDLIST;
- sc->an_ssidlist.an_len = sizeof(struct an_ltv_ssidlist);
+ sc->an_ssidlist.an_len = sizeof(struct an_ltv_ssidlist_new);
if (an_read_record(sc, (struct an_ltv_gen *)&sc->an_ssidlist)) {
printf("an%d: read record failed\n", sc->an_unit);
goto fail;
@@ -769,10 +769,11 @@ an_attach(sc, unit, flags)
bcopy(AN_DEFAULT_NODENAME, sc->an_config.an_nodename,
sizeof(AN_DEFAULT_NODENAME) - 1);
- bzero(sc->an_ssidlist.an_ssid1, sizeof(sc->an_ssidlist.an_ssid1));
- bcopy(AN_DEFAULT_NETNAME, sc->an_ssidlist.an_ssid1,
+ bzero(sc->an_ssidlist.an_entry[0].an_ssid,
+ sizeof(sc->an_ssidlist.an_entry[0].an_ssid));
+ bcopy(AN_DEFAULT_NETNAME, sc->an_ssidlist.an_entry[0].an_ssid,
sizeof(AN_DEFAULT_NETNAME) - 1);
- sc->an_ssidlist.an_ssid1_len = strlen(AN_DEFAULT_NETNAME);
+ sc->an_ssidlist.an_entry[0].an_len = strlen(AN_DEFAULT_NETNAME);
sc->an_config.an_opmode =
AN_OPMODE_INFRASTRUCTURE_STATION;
@@ -1088,7 +1089,7 @@ an_txeof(sc, status)
ifp->if_flags &= ~IFF_OACTIVE;
if (!sc->mpi350) {
- id = CSR_READ_2(sc, AN_TX_CMP_FID);
+ id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350));
if (status & AN_EV_TX_EXC) {
ifp->if_oerrors++;
@@ -1104,10 +1105,17 @@ an_txeof(sc, status)
AN_INC(sc->an_rdata.an_tx_cons, AN_TX_RING_CNT);
} else { /* MPI 350 */
- AN_INC(sc->an_rdata.an_tx_cons, AN_MAX_TX_DESC);
- if (sc->an_rdata.an_tx_prod ==
- sc->an_rdata.an_tx_cons)
- sc->an_rdata.an_tx_empty = 1;
+ id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350));
+ if (!sc->an_rdata.an_tx_empty){
+ if (status & AN_EV_TX_EXC) {
+ ifp->if_oerrors++;
+ } else
+ ifp->if_opackets++;
+ AN_INC(sc->an_rdata.an_tx_cons, AN_MAX_TX_DESC);
+ if (sc->an_rdata.an_tx_prod ==
+ sc->an_rdata.an_tx_cons)
+ sc->an_rdata.an_tx_empty = 1;
+ }
}
return;
@@ -1179,10 +1187,10 @@ an_intr(xsc)
CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0);
status = CSR_READ_2(sc, AN_EVENT_STAT(sc->mpi350));
- CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), ~AN_INTRS);
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), ~AN_INTRS(sc->mpi350));
- if (status & AN_EV_AWAKE) {
- CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_AWAKE);
+ if (status & AN_EV_MIC) {
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_MIC);
}
if (status & AN_EV_LINKSTAT) {
@@ -1199,9 +1207,16 @@ an_intr(xsc)
CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_RX);
}
+ if (sc->mpi350 && status & AN_EV_TX_CPY) {
+ an_txeof(sc, status);
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350),
+ AN_EV_TX_CPY);
+ }
+
if (status & AN_EV_TX) {
an_txeof(sc, status);
- CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_TX);
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350),
+ AN_EV_TX);
}
if (status & AN_EV_TX_EXC) {
@@ -1213,7 +1228,7 @@ an_intr(xsc)
CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_ALLOC);
/* Re-enable interrupts. */
- CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS);
+ CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
if ((ifp->if_flags & IFF_UP) && (ifp->if_snd.ifq_head != NULL))
an_start(ifp);
@@ -1238,6 +1253,7 @@ an_cmd_struct(sc, cmd, reply)
} else
break;
}
+
if( i == AN_TIMEOUT) {
printf("BUSY\n");
return(ETIMEDOUT);
@@ -1260,7 +1276,8 @@ an_cmd_struct(sc, cmd, reply)
reply->an_status = CSR_READ_2(sc, AN_STATUS(sc->mpi350));
if (CSR_READ_2(sc, AN_COMMAND(sc->mpi350)) & AN_CMD_BUSY)
- CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_CLR_STUCK_BUSY);
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350),
+ AN_EV_CLR_STUCK_BUSY);
/* Ack the command */
CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_CMD);
@@ -1728,7 +1745,7 @@ an_setdef(sc, areq)
struct ifaddr *ifa;
struct ifnet *ifp;
struct an_ltv_genconfig *cfg;
- struct an_ltv_ssidlist *ssid;
+ struct an_ltv_ssidlist_new *ssid;
struct an_ltv_aplist *ap;
struct an_ltv_gen *sp;
@@ -1748,9 +1765,9 @@ an_setdef(sc, areq)
sizeof(struct an_ltv_genconfig));
break;
case AN_RID_SSIDLIST:
- ssid = (struct an_ltv_ssidlist *)areq;
+ ssid = (struct an_ltv_ssidlist_new *)areq;
bcopy((char *)ssid, (char *)&sc->an_ssidlist,
- sizeof(struct an_ltv_ssidlist));
+ sizeof(struct an_ltv_ssidlist_new));
break;
case AN_RID_APLIST:
ap = (struct an_ltv_aplist *)areq;
@@ -1783,6 +1800,8 @@ an_setdef(sc, areq)
case AN_RID_WEP_PERM:
case AN_RID_LEAPUSERNAME:
case AN_RID_LEAPPASSWORD:
+ an_init(sc);
+
/* Disable the MAC. */
an_cmd(sc, AN_CMD_DISABLE, 0);
@@ -1859,7 +1878,7 @@ an_ioctl(ifp, command, data)
{
int error = 0;
int len;
- int i;
+ int i, max;
struct an_softc *sc;
struct ifreq *ifr;
struct thread *td = curthread;
@@ -1869,7 +1888,7 @@ an_ioctl(ifp, command, data)
struct an_ltv_genconfig *config;
struct an_ltv_key *key;
struct an_ltv_status *status;
- struct an_ltv_ssidlist *ssids;
+ struct an_ltv_ssidlist_new *ssids;
int mode;
struct aironet_ioctl l_ioctl;
@@ -1881,7 +1900,7 @@ an_ioctl(ifp, command, data)
config = (struct an_ltv_genconfig *)&sc->areq;
key = (struct an_ltv_key *)&sc->areq;
status = (struct an_ltv_status *)&sc->areq;
- ssids = (struct an_ltv_ssidlist *)&sc->areq;
+ ssids = (struct an_ltv_ssidlist_new *)&sc->areq;
if (sc->an_gone) {
error = ENODEV;
@@ -2004,18 +2023,20 @@ an_ioctl(ifp, command, data)
error = EINVAL;
break;
}
- if (ireq->i_val == 0) {
- len = ssids->an_ssid1_len;
- tmpptr = ssids->an_ssid1;
- } else if (ireq->i_val == 1) {
- len = ssids->an_ssid2_len;
- tmpptr = ssids->an_ssid2;
- } else if (ireq->i_val == 2) {
- len = ssids->an_ssid3_len;
- tmpptr = ssids->an_ssid3;
- } else {
+ max = (sc->areq.an_len - 4)
+ / sizeof(struct an_ltv_ssid_entry);
+ if ( max > MAX_SSIDS ) {
+ printf("To many SSIDs only using "
+ "%d of %d\n",
+ MAX_SSIDS, max);
+ max = MAX_SSIDS;
+ }
+ if (ireq->i_val > max) {
error = EINVAL;
break;
+ } else {
+ len = ssids->an_entry[ireq->i_val].an_len;
+ tmpptr = ssids->an_entry[ireq->i_val].an_ssid;
}
} else {
error = EINVAL;
@@ -2032,7 +2053,22 @@ an_ioctl(ifp, command, data)
IEEE80211_NWID_LEN);
break;
case IEEE80211_IOC_NUMSSIDS:
- ireq->i_val = 3;
+ sc->areq.an_len = sizeof(sc->areq);
+ sc->areq.an_type = AN_RID_SSIDLIST;
+ if (an_read_record(sc,
+ (struct an_ltv_gen *)&sc->areq)) {
+ error = EINVAL;
+ break;
+ }
+ max = (sc->areq.an_len - 4)
+ / sizeof(struct an_ltv_ssid_entry);
+ if ( max > MAX_SSIDS ) {
+ printf("To many SSIDs only using "
+ "%d of %d\n",
+ MAX_SSIDS, max);
+ max = MAX_SSIDS;
+ }
+ ireq->i_val = max;
break;
case IEEE80211_IOC_WEP:
sc->areq.an_type = AN_RID_ACTUALCFG;
@@ -2228,6 +2264,7 @@ an_ioctl(ifp, command, data)
}
switch (ireq->i_type) {
case IEEE80211_IOC_SSID:
+ sc->areq.an_len = sizeof(sc->areq);
sc->areq.an_type = AN_RID_SSIDLIST;
if (an_read_record(sc,
(struct an_ltv_gen *)&sc->areq)) {
@@ -2238,24 +2275,23 @@ an_ioctl(ifp, command, data)
error = EINVAL;
break;
}
- switch (ireq->i_val) {
- case 0:
- error = copyin(ireq->i_data,
- ssids->an_ssid1, ireq->i_len);
- ssids->an_ssid1_len = ireq->i_len;
- break;
- case 1:
- error = copyin(ireq->i_data,
- ssids->an_ssid2, ireq->i_len);
- ssids->an_ssid2_len = ireq->i_len;
+ max = (sc->areq.an_len - 4)
+ / sizeof(struct an_ltv_ssid_entry);
+ if ( max > MAX_SSIDS ) {
+ printf("To many SSIDs only using "
+ "%d of %d\n",
+ MAX_SSIDS, max);
+ max = MAX_SSIDS;
+ }
+ if (ireq->i_val > max) {
+ error = EINVAL;
break;
- case 2:
+ } else {
error = copyin(ireq->i_data,
- ssids->an_ssid3, ireq->i_len);
- ssids->an_ssid3_len = ireq->i_len;
- break;
- default:
- error = EINVAL;
+ ssids->an_entry[ireq->i_val].an_ssid,
+ ireq->i_len);
+ ssids->an_entry[ireq->i_val].an_len
+ = ireq->i_len;
break;
}
break;
@@ -2512,7 +2548,7 @@ an_init(xsc)
/* Set the ssid list */
sc->an_ssidlist.an_type = AN_RID_SSIDLIST;
- sc->an_ssidlist.an_len = sizeof(struct an_ltv_ssidlist);
+ sc->an_ssidlist.an_len = sizeof(struct an_ltv_ssidlist_new);
if (an_write_record(sc, (struct an_ltv_gen *)&sc->an_ssidlist)) {
printf("an%d: failed to set ssid list\n", sc->an_unit);
AN_UNLOCK(sc);
@@ -2548,7 +2584,7 @@ an_init(xsc)
an_cmd(sc, AN_CMD_SET_MODE, 0xffff);
/* enable interrupts */
- CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS);
+ CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
@@ -2570,7 +2606,6 @@ an_start(ifp)
int id, idx, i;
unsigned char txcontrol;
struct an_card_tx_desc an_tx_desc;
- u_int8_t *ptr;
u_int8_t *buf;
sc = ifp->if_softc;
@@ -2650,8 +2685,34 @@ an_start(ifp)
printf("an%d: xmit failed\n", sc->an_unit);
AN_INC(idx, AN_TX_RING_CNT);
+
+ /*
+ * Set a timeout in case the chip goes out to lunch.
+ */
+ ifp->if_timer = 5;
}
} else { /* MPI-350 */
+/* HACK */
+ {
+ struct an_command cmd_struct;
+ struct an_reply reply;
+ /*
+ * Allocate TX descriptor
+ */
+
+ bzero(&reply,sizeof(reply));
+ cmd_struct.an_cmd = AN_CMD_ALLOC_DESC;
+ cmd_struct.an_parm0 = AN_DESCRIPTOR_TX;
+ cmd_struct.an_parm1 = AN_TX_DESC_OFFSET;
+ cmd_struct.an_parm2 = AN_MAX_TX_DESC;
+ if (an_cmd_struct(sc, &cmd_struct, &reply)) {
+ printf("an%d: failed to allocate TX "
+ "descriptor\n",
+ sc->an_unit);
+ return;
+ }
+ }
+/* HACK */
while (sc->an_rdata.an_tx_empty ||
idx != sc->an_rdata.an_tx_cons) {
IF_DEQUEUE(&ifp->if_snd, m0);
@@ -2697,12 +2758,15 @@ an_start(ifp)
an_tx_desc.an_eoc = 1;
an_tx_desc.an_valid = 1;
an_tx_desc.an_len = 0x44 +
- tx_frame_802_3.an_tx_802_3_payload_len;
- an_tx_desc.an_phys = sc->an_tx_buffer[idx].an_dma_paddr;
- ptr = (u_int8_t*)&an_tx_desc;
- for (i = 0; i < sizeof(an_tx_desc); i++) {
- CSR_MEM_AUX_WRITE_1(sc, AN_TX_DESC_OFFSET + i,
- ptr[i]);
+ tx_frame_802_3.an_tx_802_3_payload_len;
+ an_tx_desc.an_phys
+ = sc->an_tx_buffer[idx].an_dma_paddr;
+ for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) {
+ CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET
+ /* zero for now */
+ + (0 * sizeof(an_tx_desc))
+ + (i * 4),
+ ((u_int32_t*)&an_tx_desc)[i]);
}
/*
@@ -2713,11 +2777,14 @@ an_start(ifp)
m_freem(m0);
m0 = NULL;
-
- CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_ALLOC);
-
AN_INC(idx, AN_MAX_TX_DESC);
sc->an_rdata.an_tx_empty = 0;
+ CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), AN_EV_ALLOC);
+
+ /*
+ * Set a timeout in case the chip goes out to lunch.
+ */
+ ifp->if_timer = 5;
}
}
@@ -2726,11 +2793,6 @@ an_start(ifp)
sc->an_rdata.an_tx_prod = idx;
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
return;
}
@@ -3069,13 +3131,10 @@ an_media_change(ifp)
int otype = sc->an_config.an_opmode;
int orate = sc->an_tx_rate;
- if ((sc->an_ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_ADHOC) != 0)
- sc->an_config.an_opmode = AN_OPMODE_IBSS_ADHOC;
- else
- sc->an_config.an_opmode = AN_OPMODE_INFRASTRUCTURE_STATION;
-
sc->an_tx_rate = ieee80211_media2rate(
IFM_SUBTYPE(sc->an_ifmedia.ifm_cur->ifm_media));
+ if (sc->an_tx_rate < 0)
+ sc->an_tx_rate = 0;
if (orate != sc->an_tx_rate) {
/* Read the current configuration */
@@ -3093,6 +3152,11 @@ an_media_change(ifp)
sc->an_config.an_len = sizeof(struct an_ltv_genconfig);
}
+ if ((sc->an_ifmedia.ifm_cur->ifm_media & IFM_IEEE80211_ADHOC) != 0)
+ sc->an_config.an_opmode &= ~AN_OPMODE_INFRASTRUCTURE_STATION;
+ else
+ sc->an_config.an_opmode |= AN_OPMODE_INFRASTRUCTURE_STATION;
+
if (otype != sc->an_config.an_opmode ||
orate != sc->an_tx_rate)
an_init(sc);
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index 8ed13c6..2ec7057 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -198,7 +198,7 @@ an_attach_pci(dev)
/* Allocate aux. memory */
sc->mem_aux_rid = PCIR_MAPS + 8;
error = an_alloc_aux_memory(dev, sc->mem_aux_rid,
- AN_AUXMEMSIZE);
+ AN_AUX_MEM_SIZE);
if (error) {
printf("an%d: couldn't map aux memory\n", unit);
goto fail;
diff --git a/sys/dev/an/if_anreg.h b/sys/dev/an/if_anreg.h
index 0af4506..86b5efa 100644
--- a/sys/dev/an/if_anreg.h
+++ b/sys/dev/an/if_anreg.h
@@ -95,7 +95,7 @@
/*
* Size of aux. memory space ... probably not needed DJA
*/
-#define AN_AUXMEMSIZE (256 * 1024)
+#define AN_AUX_MEM_SIZE (256 * 1024)
/*
* Hermes register definitions and what little I know about them.
@@ -181,10 +181,11 @@ struct an_card_tx_desc
u_int64_t an_phys;
};
-#define AN_RID_BUFFER_SIZE 2048
-#define AN_RX_BUFFER_SIZE 1840
-#define AN_TX_BUFFER_SIZE 1840
-#define AN_HOST_DESC_OFFSET 0x8
+#define AN_RID_BUFFER_SIZE AN_MAX_DATALEN
+#define AN_RX_BUFFER_SIZE AN_HOSTBUFSIZ
+#define AN_TX_BUFFER_SIZE AN_HOSTBUFSIZ
+/*#define AN_HOST_DESC_OFFSET 0xC sort of works */
+#define AN_HOST_DESC_OFFSET 0x800
#define AN_RX_DESC_OFFSET (AN_HOST_DESC_OFFSET + \
sizeof(struct an_card_rid_desc))
#define AN_TX_DESC_OFFSET (AN_RX_DESC_OFFSET + \
@@ -243,7 +244,7 @@ struct an_reply {
/* memory handle management registers */
#define AN_RX_FID 0x20
#define AN_ALLOC_FID 0x22
-#define AN_TX_CMP_FID 0x24
+#define AN_TX_CMP_FID(x) (x ? 0x1a : 0x24)
/*
* Buffer Access Path (BAP) registers.
@@ -276,16 +277,23 @@ struct an_reply {
/* Events */
#define AN_EV_CLR_STUCK_BUSY 0x4000 /* clear stuck busy bit */
#define AN_EV_WAKEREQUEST 0x2000 /* awaken from PSP mode */
+#define AN_EV_MIC 0x1000 /* Message Integrity Check*/
#define AN_EV_AWAKE 0x0100 /* station woke up from PSP mode*/
#define AN_EV_LINKSTAT 0x0080 /* link status available */
#define AN_EV_CMD 0x0010 /* command completed */
#define AN_EV_ALLOC 0x0008 /* async alloc/reclaim completed */
+#define AN_EV_TX_CPY 0x0400
#define AN_EV_TX_EXC 0x0004 /* async xmit completed with failure */
#define AN_EV_TX 0x0002 /* async xmit completed succesfully */
#define AN_EV_RX 0x0001 /* async rx completed */
-#define AN_INTRS \
- (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC|AN_EV_LINKSTAT)
+#define AN_INTRS(x) \
+ ( x ? (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_TX_CPY|AN_EV_ALLOC \
+ |AN_EV_LINKSTAT|AN_EV_MIC) \
+ : \
+ (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC \
+ |AN_EV_LINKSTAT|AN_EV_MIC) \
+ )
/* Host software registers */
#define AN_SW0(x) (x ? 0x50 : 0x28)
@@ -458,7 +466,7 @@ struct an_softc {
bus_dma_tag_t an_dtag;
struct an_ltv_genconfig an_config;
struct an_ltv_caps an_caps;
- struct an_ltv_ssidlist an_ssidlist;
+ struct an_ltv_ssidlist_new an_ssidlist;
struct an_ltv_aplist an_aplist;
struct an_ltv_key an_temp_keys[4];
int an_tx_rate;
OpenPOWER on IntegriCloud