Gateworks 2348 and ath problem
M. Warner Losh
imp at bsdimp.com
Thu Nov 30 07:12:06 PST 2006
In message: <20061130142146.GA50022 at zibbi.meraka.csir.co.za>
John Hay <jhay at meraka.org.za> writes:
: >
: > Ok, I built a kernel without all those options, but it didn't make a
: > difference. I also tried sta mode and it still looks the same. Some
: > new info that I have is that when I do a tcpdump on the arm box itself,
: > adding -y IEEE802_11_RADIO makes a difference. Without it the outgoing
: > packets looks ok, but with it 2 bytes are added between the ether (802.11)
: > header and the ip(v6) header.
:
: Ok, I found the problem. Using LLC_SNAPFRAMELEN works better than
: sizeof(struct llc). LLC_SNAPFRAMELEN is defined as 8 and sizeof()
: returns 10. Doing a grep in net/ if see that LLC_SNAPFRAMELEN is used
: a lot, so I guess this is the correct way go. I nobody has anything
: against it, I can commit it.
NetBSD marks it as __packed. That might be a safer patch. NetBSD
only uses LLC_SNAPFRAMELEN in token ring code.
It might be even better if we could catch these things at compile
time, but doing so may be a bit of a pita to setup (how do you know
all the relevant types to check).
Warner
: With this patch traffic seems to flow normally over the atheros wifi
: link. I have not done too much testing, but olsrd works and I can ssh
: to it.
:
: I see a lot of rix packets:
:
: Nov 30 15:49:29 arm-tst kernel: rix 2632 (0) bad ratekbps 0 mode 1
: Nov 30 15:49:29 arm-tst kernel: rix 2632 (0) bad ratekbps 0 mode 1
: Nov 30 15:49:30 arm-tst kernel: rix 2633 (0) bad ratekbps 0 mode 1
: Nov 30 15:49:30 arm-tst kernel: rix 2633 (0) bad ratekbps 0 mode 1
: Nov 30 15:49:30 arm-tst kernel: rix 2601 (0) bad ratekbps 0 mode 1
:
: I don't see it on our wrap and soekris boxes, but they are running
: 6-stable... Well I have seen it, but that was if I put the link in
: 11b mode, not in 11a or 11g mode. I'm using 11a at the moment.
:
: Sam, are they related to the rate changes you made recently?
:
: John
: --
: John Hay -- John.Hay at meraka.csir.co.za / jhay at FreeBSD.org
:
:
: --- net80211/ieee80211_input.c.org Fri Nov 24 10:57:10 2006
: +++ net80211/ieee80211_input.c Thu Nov 30 15:27:33 2006
: @@ -736,8 +736,8 @@
: struct ether_header *eh;
: struct llc *llc;
:
: - if (m->m_len < hdrlen + sizeof(*llc) &&
: - (m = m_pullup(m, hdrlen + sizeof(*llc))) == NULL) {
: + if (m->m_len < hdrlen + LLC_SNAPFRAMELEN &&
: + (m = m_pullup(m, hdrlen + LLC_SNAPFRAMELEN)) == NULL) {
: /* XXX stat, msg */
: return NULL;
: }
: @@ -746,7 +746,7 @@
: if (llc->llc_dsap == LLC_SNAP_LSAP && llc->llc_ssap == LLC_SNAP_LSAP &&
: llc->llc_control == LLC_UI && llc->llc_snap.org_code[0] == 0 &&
: llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0) {
: - m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh));
: + m_adj(m, hdrlen + LLC_SNAPFRAMELEN - sizeof(*eh));
: llc = NULL;
: } else {
: m_adj(m, hdrlen - sizeof(*eh));
: --- net80211/ieee80211_output.c.org Fri Nov 24 10:57:10 2006
: +++ net80211/ieee80211_output.c Thu Nov 30 15:22:19 2006
: @@ -500,7 +500,7 @@
: ieee80211_mbuf_adjust(struct ieee80211com *ic, int hdrsize,
: struct ieee80211_key *key, struct mbuf *m)
: {
: -#define TO_BE_RECLAIMED (sizeof(struct ether_header) - sizeof(struct llc))
: +#define TO_BE_RECLAIMED (sizeof(struct ether_header) - LLC_SNAPFRAMELEN)
: int needed_space = hdrsize;
:
: if (key != NULL) {
: @@ -527,7 +527,7 @@
: * We know we are called just before stripping an Ethernet
: * header and prepending an LLC header. This means we know
: * there will be
: - * sizeof(struct ether_header) - sizeof(struct llc)
: + * sizeof(struct ether_header) - LLC_SNAPFRAMELEN
: * bytes recovered to which we need additional space for the
: * 802.11 header and any crypto header.
: */
: @@ -675,7 +675,7 @@
: }
:
: /* NB: this could be optimized because of ieee80211_mbuf_adjust */
: - m_adj(m, sizeof(struct ether_header) - sizeof(struct llc));
: + m_adj(m, sizeof(struct ether_header) - LLC_SNAPFRAMELEN);
: llc = mtod(m, struct llc *);
: llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
: llc->llc_control = LLC_UI;
: _______________________________________________
: freebsd-arm at freebsd.org mailing list
: http://lists.freebsd.org/mailman/listinfo/freebsd-arm
: To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
:
:
More information about the freebsd-arm
mailing list