Ticket #1050 (new enhancement)

Opened 2 years ago

Last modified 4 months ago

implement a WiFi stack

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

Description

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

Attachments

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

Change History

Changed 2 years ago by axeld

  • owner axeld deleted
  • milestone changed from R1 Network Stack to Unscheduled

Shouldn't stop us from releasing R1.

Changed 16 months ago by tqh

  • cc tqh added

Changed 14 months 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.

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

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

Changed 11 months 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.

Changed 10 months ago by Adek336

  • cc adek336@… added

Changed 10 months 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?

Changed 10 months 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...

Changed 10 months ago by tqh

  • blockedby 2752 added

Changed 9 months ago by tqh

  • blockedby 2761 added

Changed 9 months 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....

Changed 9 months 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 9 months ago by tqh

modifications to src/libs/compat/freebsd_network/

Changed 9 months ago by tqh

libcrypto from FreeBSD 7

Changed 9 months 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.

Changed 9 months 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.

Changed 9 months 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.

Changed 9 months 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 ;))

Changed 8 months ago by thotypous

  • cc thotypous@… added

Changed 8 months ago by aljen

  • cc harakash@… added

Changed 8 months ago by PieterPanman

  • cc pieter@… added

Changed 7 months 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

Changed 7 months ago by ithamar

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

Changed 6 months ago by modeenf

  • cc fredrik@… added

Changed 5 months ago by tqh

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

Changed 5 months 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?

Changed 4 months ago by jprostko

  • cc joe.prostko@… added

Changed 4 months ago by colin

  • cc coling@… added
Note: See TracTickets for help on using tickets.