Re: [OpenWrt-Devel] How to modify WR703N wlan mac

2013-07-06 Thread jinzhcheng
Dear Sir

I have modified mac addr in 0x01fc00 of uboot partiton and modify 
/etc/config/wireless.
After poweron device, wlan0 can enter promiscuous mode, but after 2 seconds, 
wlan0 enter disabled state:

Jan  1 00:00:50 OpenWrt kern.info kernel: [   50.35] device wlan0 entered 
promiscuous mode
Jan  1 00:00:50 OpenWrt kern.info kernel: [   50.40] br-lan: port 2(wlan0) 
entered forwarding state
Jan  1 00:00:50 OpenWrt kern.info kernel: [   50.41] br-lan: port 2(wlan0) 
entered forwarding state
Jan  1 00:00:53 OpenWrt kern.info kernel: [   53.61] device wlan0 left 
promiscuous mode
Jan  1 00:00:53 OpenWrt kern.info kernel: [   53.61] br-lan: port 2(wlan0) 
entered disabled state

If any suggestion? Thanks!

At 2013-07-05 23:21:53,jinzhcheng  wrote:

Dear Sir
I try to modify mach-tl-wr703n.c:
static void __init tl_wr703n_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

printk("%s\n", __func__);
// set mac test, will be set same in /etc/config/wireless
*mac = 0x84;
*(mac+1) = 0x5d;
*(mac+2) = 0xd8;
*(mac+3) = 0x0;
*(mac+4) = 0x31;
*(mac+5) = 0x88;
/* disable PHY_SWAP and PHY_ADDR_SWAP bits *
... ...
but i can't modify the content of 0x1f01fc00 which is in uboot partition region
and I try to write /dev/mtd0 in userspace, but it failed too.
If any methods to modify mac?

Thank you very much!




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Setting channel on ath9k

2013-07-06 Thread LEO Airwarosu Yoichi Shinoda
Folks,

I have a trouble setting the channel on Buffalo WZR-HP-G300NH
(says its AR9100) and WHR-HP-G300N (says its AR9280)
on recent revision of the OpenWrt (r37180) with
compat-wireless-2013-06-27.

The problem is that I CAN NOT set the channel on an interface,
regardless of the up/down state of the interface.


// Make sure I start with fresh state
root@gh3:~# ifconfig -a
eth0  Link encap:Ethernet  HWaddr 00:1D:73:B3:3E:90  
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:207 errors:0 dropped:1 overruns:59125 frame:0
  TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:38989 (38.0 KiB)  TX bytes:16045 (15.6 KiB)
  Interrupt:4 

eth0.1Link encap:Ethernet  HWaddr 00:1D:73:B3:3E:90  
  BROADCAST MULTICAST  MTU:1500  Metric:1
  RX packets:196 errors:0 dropped:0 overruns:0 frame:0
  TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0 
  RX bytes:32203 (31.4 KiB)  TX bytes:14746 (14.4 KiB)

eth1  Link encap:Ethernet  HWaddr 00:1D:73:B3:3E:91  
  inet addr:192.168.0.38  Bcast:192.168.0.255  Mask:255.255.255.0
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:981 errors:0 dropped:80 overruns:0 frame:0
  TX packets:285 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:171850 (167.8 KiB)  TX bytes:34008 (33.2 KiB)
  Interrupt:5 

loLink encap:Local Loopback  
  inet addr:127.0.0.1  Mask:255.0.0.0
  UP LOOPBACK RUNNING  MTU:65536  Metric:1
  RX packets:16 errors:0 dropped:0 overruns:0 frame:0
  TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0 
  RX bytes:1536 (1.5 KiB)  TX bytes:1536 (1.5 KiB)

// Create a managed interface

root@gh3:~# iw phy0 interface add wlan0 type managed

// Confirm its creation and state (down)
root@gh3:~# ifconfig wlan0
wlan0 Link encap:Ethernet  HWaddr 00:1D:73:B3:3E:90  
  BROADCAST MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

// Try to set the channel
root@gh3:~# iw wlan0 set channel 11
command failed: Device or resource busy (-16)

// Bring the interface up, and set channel
root@gh3:~# ifconfig wlan0 up
root@gh3:~# iw wlan0 set channel 11
command failed: Device or resource busy (-16)

// Try it directly on phy
root@gh3:~# iw phy0 set channel 11
command failed: Device or resource busy (-16)


After some attempts, I found out that the only way to set the channel
is to do it through a monitor interface that is UP, and all other interfaces
on the original phy down.


root@gh3:~# iw wlan0 interface add wlan0.mon type monitor
root@gh3:~# ifconfig wlan0 down
root@gh3:~# ifconfig wlan0.mon up
root@gh3:~# iw wlan0.mon set channel 11
root@gh3:~# 


BTW,

root@gh3:~# iw --version
iw version 3.10


So, is this a broken iw? or broken ath9k driver?

Oh, and one more (maybe) trivial question.

How can I find out the current state (e.g. channel) of a phy or interface
with iw?

Any comments and pointers are welcome.

--- shinoda



smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Working with a kernel patch - compat-wireless

2013-07-06 Thread jonsm...@gmail.com
I tried the kernel patch procedure described here:
http://wiki.openwrt.org/doc/devel/patches
but that kernel tree doesn't seem be getting built

There is some interaction with the compat-wireless tree.

How can I make a kernel change, use quilt and make my image with the
device tree tacked onto it?

--
Jon Smirl
jonsm...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Working with a kernel patch - compat-wireless

2013-07-06 Thread jonsm...@gmail.com
On Sat, Jul 6, 2013 at 2:43 PM, jonsm...@gmail.com  wrote:
> I tried the kernel patch procedure described here:
> http://wiki.openwrt.org/doc/devel/patches
> but that kernel tree doesn't seem be getting built
>
> There is some interaction with the compat-wireless tree.

I should be more specific, I'm trying to work on the ralink driver.
drivers/net/wireless/rt2x00/


>
> How can I make a kernel change, use quilt and make my image with the
> device tree tacked onto it?
>
> --
> Jon Smirl
> jonsm...@gmail.com



--
Jon Smirl
jonsm...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Working with a kernel patch - compat-wireless

2013-07-06 Thread Felix Fietkau
On 2013-07-06 8:59 PM, jonsm...@gmail.com wrote:
> On Sat, Jul 6, 2013 at 2:43 PM, jonsm...@gmail.com  wrote:
>> I tried the kernel patch procedure described here:
>> http://wiki.openwrt.org/doc/devel/patches
>> but that kernel tree doesn't seem be getting built
>>
>> There is some interaction with the compat-wireless tree.
> 
> I should be more specific, I'm trying to work on the ralink driver.
> drivers/net/wireless/rt2x00/
Everything wireless driver related is built outside of the kernel tree
by package/kernel/mac80211, which keeps its build tree in
build_dir/target-*/linux-*/compat-wireless-*
You can use quilt on that one like with any other normal package.

- Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel