Official Gitbrew Forums
These forums cover all aspects of the Gitbrew biosphere. If you would like your development project to be based here, ask an admin.

Home » PS3 » OtherOS++ » Linux » PS3 WLAN Access Point
PS3 WLAN Access Point [message #531] Fri, 03 February 2012 18:05 Go to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Would be great to have AP functionality on PS3.
Then we could use AP on petitboot e.g. and connect to it without needing any routers Very Happy Cool Very Happy
Re: PS3 WLAN Access Point [message #532 is a reply to message #531] Fri, 03 February 2012 18:06 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Have to find time and write down the AP driver for Linux.
Re: PS3 WLAN Access Point [message #1238 is a reply to message #532] Sat, 05 May 2012 10:32 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
First i have to port STA driver to cfg80211 interface in order to learn how cfg80211 works. And then implement AP mode.
It is a pain to implement AP mode with Wireless Extensions.
Another advantage of nl80211 is that we can use hostapd daemon for AP mode.


http://linuxwireless.org/en/developers/Documentation/cfg8021 1

[Updated on: Sat, 05 May 2012 11:39]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1239 is a reply to message #1238] Sat, 05 May 2012 10:56 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Good example: http://lxr.free-electrons.com/source/drivers/net/wireless/iw mc3200wifi/cfg80211.c
Re: PS3 WLAN Access Point [message #1240 is a reply to message #1239] Sat, 05 May 2012 10:57 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
And use notifier chains: http://www.linuxforu.com/2009/01/the-crux-of-linux-notifier- chains/

for event dispatching. Remove RCU hack from ps3_jupiter.c

[Updated on: Sat, 05 May 2012 11:30]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1250 is a reply to message #1240] Sat, 05 May 2012 22:03 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Arch Linux PPC has problems with iw package. No problemo. We can compile it.

Grab the latest version here: http://linuxwireless.org/download/iw/iw-3.4.tar.bz2

Install pkg-config on Arch.
Extract iw-3.4.tar.bz2 and "make" it.
Make sure you load cfg80211.ko kernel module before using iw command.

iw command help: http://linuxwireless.org/en/users/Documentation/iw

[Updated on: Sat, 05 May 2012 22:07]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1251 is a reply to message #1250] Sat, 05 May 2012 22:05 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
I ported STA driver to cfg80211 interface but having problems with it currently and trying to fix it. As soon as it is stable, i will upload it for testing.
cfg80211 makes a lot of things easier.

[Updated on: Sat, 05 May 2012 22:05]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1252 is a reply to message #1251] Sat, 05 May 2012 22:33 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Cool Smile

iw dev wlan0 scan works already.
Re: PS3 WLAN Access Point [message #1254 is a reply to message #1252] Sat, 05 May 2012 23:53 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Not a good idea to use cfg80211 for full MAC devices like PS3 WLAN.
I need they keys before connecting to AP but nl80211 driver of wpa_supplicant sets the ykey s after. Damn.
Back to WEXT i guess.
Re: PS3 WLAN Access Point [message #1255 is a reply to message #1254] Sun, 06 May 2012 01:08 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Found a memory leak in STA driver. Fixed.
Re: PS3 WLAN Access Point [message #1256 is a reply to message #1255] Sun, 06 May 2012 01:15 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Here is the new PS3 JUPITER STA patch with several bugs fixed: http://gitbrew.org/~glevand/ps3/linux/linux-3/patches-3.3/ps 3jupiter.patch
Re: PS3 WLAN Access Point [message #1257 is a reply to message #1256] Sun, 06 May 2012 01:16 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Ok, so STA mode cannot be used with nl80211, too bad Sad
But for AP mode we have to use nl80211, hostapd doesn't support wext.
Re: PS3 WLAN Access Point [message #1448 is a reply to message #1257] Sun, 17 June 2012 11:24 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Started implementing AP Mode for PS3 Jupiter.

I intend to use cfg80211 interface which is supported by hostapd.

Good example how to implement cfg80211 interface for FullMAC AP mode: http://lxr.free-electrons.com/source/drivers/net/wireless/at h/ath6kl/cfg80211.c

[Updated on: Sun, 17 June 2012 11:28]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1504 is a reply to message #1448] Sat, 23 June 2012 09:46 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
CONFIG_DYNAMIC_PRINTK is really handy while debugging your Linux drivers.

http://www.mjmwired.net/kernel/Documentation/dynamic-debug-h owto.txt
Re: PS3 WLAN Access Point [message #1505 is a reply to message #1504] Sat, 23 June 2012 10:35 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Compiling latest libnl: http://www.linuxfromscratch.org/blfs/view/svn/basicnet/libnl .html
Re: PS3 WLAN Access Point [message #1506 is a reply to message #1505] Sat, 23 June 2012 10:36 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Compiling HOSTAPD: http://wireless.kernel.org/en/users/Documentation/hostapd
Re: PS3 WLAN Access Point [message #1507 is a reply to message #1506] Sat, 23 June 2012 11:10 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
HOSTAPD doesn't support libnl 3 yet, use libnl 2.

http://www.infradead.org/~tgr/libnl/files/libnl-2.0.tar.gz

[Updated on: Sat, 23 June 2012 11:34]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1508 is a reply to message #1507] Sat, 23 June 2012 11:29 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Creating AP device:

iw phy phy0 interface add wlan1 type __ap
Re: PS3 WLAN Access Point [message #1509 is a reply to message #1508] Sat, 23 June 2012 11:30 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Example of hostapd.conf:

interface=wlan1
driver=nl80211
ssid=test
channel=1

[Updated on: Sat, 23 June 2012 11:35]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1514 is a reply to message #1509] Sat, 23 June 2012 14:35 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Damn, getting kernel error when creating new wlan interface.

usbcore: registered new interface driver ps3_jupiter_ap

=============================================
[ INFO: possible recursive locking detected ]
3.4.4 #1 Tainted: G           O
---------------------------------------------
iw/1640 is trying to acquire lock:
 (rtnl_mutex){+.+.+.}, at: [<c0000000003618d0>] .rtnl_lock+0x20/0x38

but task is already holding lock:
 (rtnl_mutex){+.+.+.}, at: [<c0000000003618d0>] .rtnl_lock+0x20/0x38

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(rtnl_mutex);
  lock(rtnl_mutex);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by iw/1640:
 #0:  (genl_mutex){+.+.+.}, at: [<c0000000003732b8>] .genl_lock+0x20/0x38
 #1:  (rtnl_mutex){+.+.+.}, at: [<c0000000003618d0>] .rtnl_lock+0x20/0x38
 #2:  (&rdev->mtx){+.+.+.}, at: [<d000000000009b80>] .cfg80211_get_dev_from_info+0x58/0x88 [cfg80211]

stack backtrace:
Call Trace:
[c0000000067cee50] [c0000000000119a0] .show_stack+0x70/0x1a8 (unreliable)
[c0000000067cef00] [c0000000000910c0] .__lock_acquire+0x1098/0x1ce0
[c0000000067cf080] [c0000000000922ec] .lock_acquire+0x9c/0xd8
[c0000000067cf150] [c00000000045b770] .mutex_lock_nested+0x68/0x440
[c0000000067cf240] [c0000000003618d0] .rtnl_lock+0x20/0x38
[c0000000067cf2c0] [c0000000003533fc] .register_netdev+0x14/0x40
[c0000000067cf340] [d0000000000a93c4] .ps3_jupiter_ap_cfg80211_add_virtual_intf+0xfc/0x178 [ps3_jupiter_ap]
[c0000000067cf3f0] [d0000000000163e4] .nl80211_new_interface+0x104/0x1f8 [cfg80211]
[c0000000067cf4a0] [c0000000003735a0] .genl_rcv_msg+0x290/0x370
[c0000000067cf5c0] [c000000000372420] .netlink_rcv_skb+0x100/0x138
[c0000000067cf650] [c0000000003732f8] .genl_rcv+0x28/0x40
[c0000000067cf6e0] [c000000000371c28] .netlink_unicast+0x288/0x2e8
[c0000000067cf7a0] [c000000000372124] .netlink_sendmsg+0x344/0x3a8
[c0000000067cf890] [c000000000332e74] .sock_sendmsg+0x94/0xd0
[c0000000067cfa50] [c00000000033331c] .__sys_sendmsg+0x334/0x348
[c0000000067cfc50] [c000000000335540] .SyS_sendmsg+0x50/0xb0
[c0000000067cfd20] [c00000000036aec0] .compat_sys_sendmsg+0x18/0x30
[c0000000067cfd90] [c00000000036b348] .compat_sys_socketcall+0x2a0/0x2f0
[c0000000067cfe30] [c0000000000097b4] syscall_exit+0x0/0x38


Re: PS3 WLAN Access Point [message #1515 is a reply to message #1514] Sat, 23 June 2012 18:12 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Damn, hostapd needs a monitor wireless device too to work properly.
Re: PS3 WLAN Access Point [message #1549 is a reply to message #1515] Sun, 24 June 2012 15:13 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Here is an application to play with PS3 Jupiter in user space with libusb.

http://gitbrew.org/~glevand/ps3/linux/ps3_jupiter_libusb.tar .gz

Try it out and you should see a new AP with SSID "wlan_rockz" on channel 6 with no security Smile

[glevand@arch ps3_jupiter_libusb]$ sudo ./ps3_jupiter_ap
EURUS command 0x114f status (0x0006)
got event (0x00000400 0x00000010 0x000d0dd2 0x00000000 0xc00290fc)
got event (0x00000080 0x00001000 0x000d0dd4 0x00000004 0xc00290fc)
firmware version: JUPITER-TWO-FW-20.0.12.p0(Jan 19 2010 21:20:53)
got event (0x00000100 0x00000010 0x000d0dd7 0x00000001 0xc00290fc)

[Updated on: Sun, 24 June 2012 21:05]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1564 is a reply to message #1549] Mon, 25 June 2012 19:26 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Hmm, if i use parameter 0 with command 0x1 then my SSID "wlan_rockz" is ignored and instead i see this:

          Cell 07 - Address: 00:00:00:00:00:00
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=60/70  Signal level=-50 dBm  
                    Encryption key:off
                    ESSID:"Eurus_Primary_Phy1"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master


In this case SSID is "Eurus_Primary_Phy1".

[Updated on: Mon, 25 June 2012 19:35]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1565 is a reply to message #1564] Mon, 25 June 2012 19:34 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Figured out that command 0x1dd starts/stops AP mode Smile
Re: PS3 WLAN Access Point [message #1566 is a reply to message #1565] Mon, 25 June 2012 19:40 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Cool Smile Command 0x61 is used to enable/disable encryption.
Re: PS3 WLAN Access Point [message #1576 is a reply to message #1566] Fri, 29 June 2012 20:07 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Hmm, having problems with USB Bulk transfers and libusb.

ps3-ehci-driver sb_08: force halt; handshake d000080080740014 00004000 00000000 -> -110
ps3-ehci-driver sb_08: HC died; cleaning up
usb 2-2: USB disconnect, device number 2
usb 2-2: usbfs: usb_submit_urb returned -110


It seems that i'm not the only one having this problem.

http://marc.info/?l=linux-usb&m=132440828606642&w=2
Re: PS3 WLAN Access Point [message #1577 is a reply to message #1576] Fri, 29 June 2012 20:14 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Here is the patch: http://gitbrew.org/~glevand/ps3/linux/linux-3/usb-host-fix.p atch
Testing it now.
The patch applies to 3.4.4 Linux kernel with no problems.

[Updated on: Fri, 29 June 2012 20:19]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1578 is a reply to message #1577] Fri, 29 June 2012 20:23 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Yeah Smile The patch fixes the problem. PS3 WLAN AP tests go on.

[Updated on: Fri, 29 June 2012 20:24]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1579 is a reply to message #1578] Fri, 29 June 2012 20:26 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Hmm, in AP Mode i got 2 new to me unknown events:

got event (0x00000100 0x00000010 0x0000b28d 0x00000001 0xc00290fc)
got event (0x00000100 0x00000002 0x0000b329 0x00000004 0xc00290fc)
Re: PS3 WLAN Access Point [message #1580 is a reply to message #1579] Fri, 29 June 2012 20:31 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Mega Cool Smile I can associate to my PS3 AP with a WLAN client.

Every time i associate i get this event:

got event (0x00000008 0x00000010 0x0000ee4b 0x00000008 0xc00290fc)


And every time i disconnect i get this event:

got event (0x00000010 0x00000002 0x000105fb 0x0000000e 0xc00290fc)



Here is output of iwconfig on my client:

wlan1     IEEE 802.11abgn  ESSID:"wlan_rockz"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:00:00:00:00:00   
          Bit Rate=1 Mb/s   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=54/70  Signal level=-56 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:1   Missed beacon:0

[Updated on: Fri, 29 June 2012 20:32]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1581 is a reply to message #1580] Fri, 29 June 2012 20:35 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Data reception doesn't work yet. Probably i need to configure it properly in order to enable data reception.

[Updated on: Fri, 29 June 2012 20:37]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1582 is a reply to message #1581] Fri, 29 June 2012 20:44 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Yuhu Smile Data reception works Smile

Tested with arping.

How to associate with AP:
iwconfig wlan1 essid "wlan_rockz"
ifconfig wlan1 up


[glevand@arch ps3_jupiter_libusb]$ sudo ./ps3_jupiter_ap
EURUS command 0x114f status (0x0006)
got event (0x00000400 0x00000010 0x00023968 0x00000000 0xc00290fc)
got event (0x00000080 0x00001000 0x0002396b 0x00000004 0xc00290fc)
firmware version: JUPITER-TWO-FW-20.0.12.p0(Jan 19 2010 21:20:53)
got event (0x00000100 0x00000010 0x0002396d 0x00000001 0xc00290fc)

got event (0x00000008 0x00000010 0x00023d80 0x00000008 0xc00290fc)
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42
RX transfer completed with length 42  <----------- 42 is length of ARP packet


Cool, now we can use AP mode on our PS3.

[Updated on: Fri, 29 June 2012 20:50]

Report message to a moderator

Re: PS3 WLAN Access Point [message #1583 is a reply to message #1582] Fri, 29 June 2012 21:02 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
The only question is now which Linux kernel WLAN interface to use: WEXT or cfg80211.
Re: PS3 WLAN Access Point [message #1584 is a reply to message #1583] Fri, 29 June 2012 21:25 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
We have ti use WEXT interface because hostapd+cfg80211 need monitor device which we don't have.
Re: PS3 WLAN Access Point [message #1586 is a reply to message #1584] Sat, 30 June 2012 12:42 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
As i said, hostapd is out of the question because we need a monitor device but PS3 AP mode is a FullMAC device.
No chance with hostap. But WEXT has problems too. E.g. how to set WPA PSK mode ? iwconfig doesn't offer this feature.
So, for now only no security or WEP is possible.
Re: PS3 WLAN Access Point [message #1587 is a reply to message #1586] Sat, 30 June 2012 14:30 Go to previous message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Figured out new commands: 0x104d and 0x104f.

0x104d enables/disables Short Slot Time (see 802.11 spec)
0x104f returns current Short Slot Time configuration.
Previous Topic: ubuntu help
Next Topic: Just Starting Out - PS3
Goto Forum:
  


Current Time: Wed Jun 19 22:30:18 CEST 2013

Total time taken to generate the page: 0.02490 seconds