Opened 12 years ago

Closed 7 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:
Has a Patch: no 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 11 years ago.
FreeBSD's libnet80211, extract to 3rdparty/tqh nowhere near done.
modified_bsd_headers.patch (26.8 KB) - added by tqh 11 years ago.
modifications to src/libs/compat/freebsd_network/
crypto.tar.gz (82.9 KB) - added by tqh 11 years ago.
libcrypto from FreeBSD 7
ieee80211_driver.h (6.6 KB) - added by tqh 10 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 Changed 12 years ago by axeld

Milestone: R1 Network StackUnscheduled
Owner: axeld deleted

Shouldn't stop us from releasing R1.

comment:2 Changed 11 years ago by tqh

Cc: tqh added

comment:3 Changed 11 years ago by tqh

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 Changed 11 years ago by tqh

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).

Changed 11 years ago by tqh

Attachment: net80211.tar.gz added

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

comment:5 Changed 11 years ago by tqh

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 Changed 11 years ago by Adek336

Cc: adek336@… added

comment:7 Changed 11 years ago by tqh

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 Changed 11 years ago by bonefish

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 Changed 11 years ago by tqh

Blocked By: 2752 added

comment:10 Changed 11 years ago by tqh

Blocked By: 2761 added

comment:11 Changed 11 years ago by ithamar

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 Changed 11 years ago by tqh

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.

Changed 11 years ago by tqh

Attachment: modified_bsd_headers.patch added

modifications to src/libs/compat/freebsd_network/

Changed 11 years ago by tqh

Attachment: crypto.tar.gz added

libcrypto from FreeBSD 7

comment:13 Changed 11 years ago by tqh

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 Changed 11 years ago by tqh

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 Changed 11 years ago by tqh

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 Changed 11 years ago by ithamar

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 Changed 11 years ago by thotypous

Cc: thotypous@… added

comment:18 Changed 11 years ago by aljen

Cc: harakash@… added

comment:19 Changed 11 years ago by PieterPanman

Cc: pieter@… added

comment:20 Changed 10 years ago by PieterPanman

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 Changed 10 years ago by ithamar

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

comment:23 Changed 10 years ago by modeenf

Cc: fredrik@… added

Changed 10 years ago by tqh

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 Changed 10 years ago by Dessimat0r

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 Changed 10 years ago by jprostko

Cc: joe.prostko@… added

comment:26 Changed 10 years ago by colin

Cc: coling@… added

comment:27 Changed 9 years ago by mmadia

Owner: set to colin

comment:28 Changed 9 years ago by colin

Status: newin-progress

comment:29 Changed 8 years ago by nathanhi

Cc: nathanhirschauer@… added

comment:30 Changed 7 years ago by tqh

Resolution: fixed
Status: in-progressclosed

This has been fixed for some time.

Note: See TracTickets for help on using tickets.