tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Adding a parameter to net80211_input?



Hi,

I've been working on importing support for RALink 2860 devices from
OpenBSD, because that's the WLAN chip the EeeBox has.

Like wi(4), this chip is able to do encryption and decryption in the
hardware.  Like wi(4), it has the issue that the net80211 layer isn't
too keen on the idea.

wi(4) has a weird workaround for that, clearing _F_DROPUNENC from the
ic's flags when deemed appropriate.

I've been thinking of what could be a better solution, and so far the
best I could come up with is to pass an additional parameter to
ieee80211_input() indicating that the frame has been decrypted already,
when appropriate.

There is more needed to make wi(4) work in hostap mode (although I
don't have that one handy, sorry).

Would anyone think of a better way of doing that?

Obviously I'd like to commit that support as soon as possible and
hopefully as less intrusively as possible...

I note that FreeBSD's wi(4) doesn't seem to have that workaround, or an
additional parameter to ieee80211_input.  My guess is that either the
driver is broken with WEP, or they changed it so it doesn't do any
crypto in hardware...

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.
Index: ieee80211_input.c
===================================================================
RCS file: /cvsroot/src/sys/net80211/ieee80211_input.c,v
retrieving revision 1.66
diff -u -r1.66 ieee80211_input.c
--- ieee80211_input.c   4 Mar 2007 07:54:11 -0000       1.66
+++ ieee80211_input.c   3 Sep 2008 03:46:31 -0000
@@ -161,8 +161,8 @@
  * by the 802.11 layer.
  */
 int
-ieee80211_input(struct ieee80211com *ic, struct mbuf *m,
-       struct ieee80211_node *ni, int rssi, u_int32_t rstamp)
+ieee80211_input2(struct ieee80211com *ic, struct mbuf *m,
+       struct ieee80211_node *ni, int rssi, u_int32_t rstamp, bool decrypted)
 {
 #define        SEQ_LEQ(a,b)    ((int)((a)-(b)) <= 0)
 #define        HAS_SEQ(type)   ((type & 0x4) == 0)
@@ -500,7 +500,7 @@
                         * any non-PAE frames received without encryption.
                         */
                        if ((ic->ic_flags & IEEE80211_F_DROPUNENC) &&
-                           key == NULL &&
+                           key == NULL && !decrypted &&
                            eh->ether_type != htons(ETHERTYPE_PAE)) {
                                /*
                                 * Drop unencrypted frames.
Index: ieee80211_proto.h
===================================================================
RCS file: /cvsroot/src/sys/net80211/ieee80211_proto.h,v
retrieving revision 1.17
diff -u -r1.17 ieee80211_proto.h
--- ieee80211_proto.h   28 Jul 2008 17:54:02 -0000      1.17
+++ ieee80211_proto.h   3 Sep 2008 03:46:31 -0000
@@ -58,8 +58,10 @@
 void   ieee80211_proto_detach(struct ieee80211com *);
 
 struct ieee80211_node;
-int    ieee80211_input(struct ieee80211com *, struct mbuf *,
-               struct ieee80211_node *, int, u_int32_t);
+int    ieee80211_input2(struct ieee80211com *, struct mbuf *,
+               struct ieee80211_node *, int, u_int32_t, bool);
+#define        ieee80211_input(ic, m, ni, rssi, ts) \
+       ieee80211_input2(ic, m, ni, rssi, ts, false)
 int    ieee80211_setup_rates(struct ieee80211_node *ni,
                const u_int8_t *rates, const u_int8_t *xrates, int flags);
 void   ieee80211_saveie(u_int8_t **, const u_int8_t *);

Attachment: pgposhhP9Jpuo.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index