Opened 18 years ago

Closed 13 years ago

#1050 closed enhancement (fixed)

implement a WiFi stack

Reported by: wkornewald Owned by: colin
Priority: normal Milestone: Unscheduled
Component: Network & Internet/Wireless Version: R1/pre-alpha1
Keywords: Cc: tqh, adek336@…, ithamar@…, thotypous@…, harakash@…, pieter@…, fredrik@…, Dessimat0r@…, joe.prostko@…, coling@…, nathanhirschauer@…
Blocked By: #2752, #2761 Blocking:
Platform: All

Description

We need support for multiple WiFi cards and firmware-provided encryption functions.

Attachments (4)

net80211.tar.gz (294.9 KB ) - added by tqh 16 years ago.
FreeBSD's libnet80211, extract to 3rdparty/tqh nowhere near done.
modified_bsd_headers.patch (26.8 KB ) - added by tqh 16 years ago.
modifications to src/libs/compat/freebsd_network/
crypto.tar.gz (82.9 KB ) - added by tqh 16 years ago.
libcrypto from FreeBSD 7
ieee80211_driver.h (6.6 KB ) - added by tqh 16 years ago.
Very very rough example of what the driver interface 'can' look like. Only for discussion. See comments in file.

Download all attachments as: .zip

Change History (34)

comment:1 by axeld, 17 years ago

Milestone: R1 Network StackUnscheduled
Owner: axeld removed

Shouldn't stop us from releasing R1.

comment:2 by tqh, 17 years ago

Cc: tqh added

comment:3 by tqh, 17 years ago

For what's it worth. I'm working on getting net80211 to compile from FreeBSD trunk. To me it looks like it will compile with just supplying the right compabilityheaders and libcrypto.

After that I believe network gurus will need to help/review the work.

comment:4 by tqh, 16 years ago

Added a basic port of FreeBSD's libcrypto, asm not enabled and some algos disabled. Enough needed to be able to work on net80211 which is WIP.

No tests other than that it compiles. (I may have some changes to existing Haiku BSD headers, so contact me if something is fishy).

by tqh, 16 years ago

Attachment: net80211.tar.gz added

FreeBSD's libnet80211, extract to 3rdparty/tqh nowhere near done.

comment:5 by tqh, 16 years ago

net80211 just added if someone wants to take a look at the code. It does not compile and is nowhere near finished, but I'm working on it when I have the time.

Right now I just to fill in missing headers / functions where possible without changing FreeBSD code. Hence the strange code structure. Also an equivalent to ieee80211_freebsd.c is needed for Haiku.

comment:6 by Adek336, 16 years ago

Cc: adek336@… added

comment:7 by tqh, 16 years ago

I need a mapping atomic_cmpset_int( dest, exp, src ) to our atomic_test_and_set It should be easy to figure out for someone who has kept his x86 asm knowledge up to date from http://fxr.watson.org/fxr/source/i386/include/atomic.h?im=bigexcerpts#L145 and http://haiku.it.su.se:8180/source/xref/src/system/libroot/os/arch/x86/atomic.S

My guess #define atomic_cmpset_int( dest, exp, src )

atomic_test_and_set(dest, src, expr)

It should probably be added to src/libs/compat/freebsd_network/compat/machine/atomic.h after that. Any help?

comment:8 by bonefish, 16 years ago

No assembly needed:

/*
 * Atomic compare and set, used by the mutex functions
 *
 * if (*dst == exp) *dst = src (all 32 bit words)
 *
 * Returns 0 on failure, non-zero on success
 */

So it should be something like:

static inline int
atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
{
    return atomic_test_and_set((vint32*)dst, src, exp) == exp;
}

Untested...

comment:9 by tqh, 16 years ago

Blocked By: 2752 added

comment:10 by tqh, 16 years ago

Blocked By: 2761 added

comment:11 by ithamar, 16 years ago

do you want any help on this? I'm really interested in getting this to work too, but don't want to start double work here. WiFi is a pretty important meeting to me....

comment:12 by tqh, 16 years ago

Yes, I want all the help I can get. I'm not that experienced with network stacks and it is at a point where I need to learn a lot to get much further.

I'll put up the latest code in this bug.

by tqh, 16 years ago

Attachment: modified_bsd_headers.patch added

modifications to src/libs/compat/freebsd_network/

by tqh, 16 years ago

Attachment: crypto.tar.gz added

libcrypto from FreeBSD 7

comment:13 by tqh, 16 years ago

For some reason it thinks net80211.tar.gz is too big, so can't replace the existing one. Get it from this link in the meantime.

comment:14 by tqh, 16 years ago

Some short notes, the Jamfile setup is probably not very good and should be done properly.

The ieee80211_haiku.h and ieee80211_haiku.c needs proper implementation. ieee80211_haiku.h is real ugly ATM as it is where I add a lot of what I am experimenting with before trying to clean it up.

Almost no changes has been to the files coming from FreeBSD except for ieee80211_var.h which has the 'portability glue' ifdefing different platforms.

comment:15 by tqh, 16 years ago

As I'm currently focusing on Firefox, it might be a good point for someone who wants to finish the port to take over. I don't think it's to much work for someone who has good knowledge of the kernel and the network stack.

Ithamar asked, but I don't think he is cc'ed and I don't have permission to add him.

comment:16 by ithamar, 16 years ago

Cc: ithamar@… added

ok, I just downloaded the code and hope to start looking at it soon, thanks for sharing! (and thanks for Urias to send me a quick mail to point me to your replies ;))

comment:17 by thotypous, 16 years ago

Cc: thotypous@… added

comment:18 by aljen, 16 years ago

Cc: harakash@… added

comment:19 by PieterPanman, 16 years ago

Cc: pieter@… added

comment:20 by PieterPanman, 16 years ago

Well as soon as some progress is made I will help testing with my intel 4965agn. It should be supported by the iwn driver. http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/iwn/if_iwn.c

comment:22 by ithamar, 16 years ago

thanks humdinger, I'm looking into that as well ;)

comment:23 by modeenf, 16 years ago

Cc: fredrik@… added

by tqh, 16 years ago

Attachment: ieee80211_driver.h added

Very very rough example of what the driver interface 'can' look like. Only for discussion. See comments in file.

comment:24 by Dessimat0r, 16 years ago

Cc: Dessimat0r@… added

If this gets completed (I'm hoping it does, for the sake of Eee PCs everywhere :)), I assume that we'd need something to link the Wifi driver to the UI to allow users to select which network they'd like to join, and to actively display connection quality. Perhaps we should be producing mock-ups of this, or is it too soon?

comment:25 by jprostko, 16 years ago

Cc: joe.prostko@… added

comment:26 by colin, 16 years ago

Cc: coling@… added

comment:27 by mmadia, 15 years ago

Owner: set to colin

comment:28 by colin, 15 years ago

Status: newin-progress

comment:29 by nathanhi, 13 years ago

Cc: nathanhirschauer@… added

comment:30 by tqh, 13 years ago

Resolution: fixed
Status: in-progressclosed

This has been fixed for some time.

Note: See TracTickets for help on using tickets.