Ok.
My setup is as follows:
2x rpi 2
OSMC updated with apt-get dist-uprade
to latest version, running:
Linux version 4.2.3-2-osmc (root@vero) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP PREEMPT Mon Oct 12 01:58:40 UTC 2015
Both RPIs are booting via NFS (the SD card is used just /boot).
/boot/config.txt:
decode_WVC1=<my keys>
hdmi_mode=16
over_voltage=0
sdtv_mode=2
force_turbo=0
gpu_mem_512=144
over_voltage_sdram=0
core_freq=450
initial_turbo=0
start_x=1
hdmi_edid_file=1
max_usb_current=1
hdmi_ignore_cec_init=1
disable_overscan=1
sdtv_aspect=3
hdmi_force_hotplug=1
decode_MPG2=<my keys>
hdmi_drive=2
arm_freq=900
gpu_mem_256=112
sdram_freq=450
Both RPIs have a WiFi USB dongle: Logilink, WL0151 (cfg80211)
This is used with hostapd, to run an access point.
Examining dmesg I see that the kernel starts emitting errors as soon as the bridge (eth0, wlan0) is configured:
[ 141.888028] device eth0 entered promiscuous mode
[ 141.888281] br0: port 1(eth0) entered forwarding state
[ 141.888324] br0: port 1(eth0) entered forwarding state
[ 142.095002] ------------[ cut here ]------------
[ 142.095171] WARNING: CPU: 3 PID: 1623 at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x258/0x25c [mac80211]()
[ 142.095187] wlan0: Failed check-sdata-in-driver check, flags: 0x0
[ 142.095200] Modules linked in: bridge stp llc arc4 rt2800usb rt2800lib crc_ccitt rt2x00usb rt2x00lib mac80211 cfg80211 rfkill bcm2835_gpiomem bcm2835_thermal uio_pdrv_genirq uio fuse ipv6
[ 142.095321] CPU: 3 PID: 1623 Comm: iwconfig Not tainted 4.2.3-2-osmc #1
[ 142.095333] Hardware name: BCM2709
[ 142.095381] [<8001f624>] (unwind_backtrace) from [<8001b020>] (show_stack+0x20/0x24)
[ 142.095412] [<8001b020>] (show_stack) from [<8071ea20>] (dump_stack+0x9c/0xdc)
[ 142.095444] [<8071ea20>] (dump_stack) from [<80032ce0>] (warn_slowpath_fmt+0xa8/0xfc)
[ 142.095564] [<80032ce0>] (warn_slowpath_fmt) from [<7f194c24>] (ieee80211_bss_info_change_notify+0x258/0x25c [mac80211])
[ 142.095801] [<7f194c24>] (ieee80211_bss_info_change_notify [mac80211]) from [<7f1ad9d4>] (ieee80211_recalc_txpower+0x9c/0xe0 [mac80211])
[ 142.096034] [<7f1ad9d4>] (ieee80211_recalc_txpower [mac80211]) from [<7f1b5d58>] (ieee80211_set_tx_power+0x84/0x184 [mac80211])
[ 142.096405] [<7f1b5d58>] (ieee80211_set_tx_power [mac80211]) from [<7f12a2a4>] (cfg80211_wext_siwtxpower+0xac/0x234 [cfg80211])
[ 142.096595] [<7f12a2a4>] (cfg80211_wext_siwtxpower [cfg80211]) from [<80714ad0>] (ioctl_standard_call+0x70/0x4d0)
[ 142.096622] [<80714ad0>] (ioctl_standard_call) from [<807152a0>] (wext_handle_ioctl+0x1b8/0x238)
[ 142.096651] [<807152a0>] (wext_handle_ioctl) from [<80631a64>] (dev_ioctl+0x594/0xa68)
[ 142.096682] [<80631a64>] (dev_ioctl) from [<805eeafc>] (sock_ioctl+0x12c/0x2b0)
[ 142.096714] [<805eeafc>] (sock_ioctl) from [<801ec968>] (SyS_ioctl+0x3a4/0x640)
[ 142.096744] [<801ec968>] (SyS_ioctl) from [<80016ce0>] (ret_fast_syscall+0x0/0x54)
[ 142.096758] ---[ end trace 1f0dfc031ad6207f ]---
[ 142.309324] cfg80211: Regulatory domain changed to country: GR
[ 142.309353] cfg80211: DFS Master region: ETSI
[ 142.309363] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 142.309376] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 142.309391] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 142.309404] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 142.309415] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
[ 142.309426] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[ 142.436011] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[ 142.443089] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29
[ 142.727813] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 142.730267] device wlan0 entered promiscuous mode
[ 142.730563] br0: port 2(wlan0) entered listening state
[ 142.730617] br0: port 2(wlan0) entered listening state
[ 142.881240] br0: port 2(wlan0) entered disabled state
[ 144.382017] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 144.382233] br0: port 2(wlan0) entered listening state
[ 144.382295] br0: port 2(wlan0) entered listening state
[ 156.901155] br0: port 1(eth0) entered forwarding state
[ 159.421161] br0: port 2(wlan0) entered learning state
[ 168.718071] eth0: hw csum failure
[ 168.718120] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.2.3-2-osmc #1
[ 168.718134] Hardware name: BCM2709
[ 168.718187] [<8001f624>] (unwind_backtrace) from [<8001b020>] (show_stack+0x20/0x24)
[ 168.718221] [<8001b020>] (show_stack) from [<8071ea20>] (dump_stack+0x9c/0xdc)
[ 168.718253] [<8071ea20>] (dump_stack) from [<8060d704>] (netdev_rx_csum_fault+0x44/0x48)
[ 168.718284] [<8060d704>] (netdev_rx_csum_fault) from [<8060220c>] (__skb_checksum_complete+0xb4/0xb8)
[ 168.718314] [<8060220c>] (__skb_checksum_complete) from [<806dd82c>] (ipv6_mc_validate_checksum+0xa8/0x150)
[ 168.718339] [<806dd82c>] (ipv6_mc_validate_checksum) from [<805fd3a4>] (skb_checksum_trimmed+0x98/0x18c)
[ 168.718365] [<805fd3a4>] (skb_checksum_trimmed) from [<806dd9d8>] (ipv6_mc_check_mld+0x104/0x33c)
[ 168.718451] [<806dd9d8>] (ipv6_mc_check_mld) from [<7f2d2638>] (br_multicast_rcv+0x68/0x10a4 [bridge])
[ 168.718539] [<7f2d2638>] (br_multicast_rcv [bridge]) from [<7f2c8880>] (br_handle_frame_finish+0x1b4/0x5ac [bridge])
[ 168.718603] [<7f2c8880>] (br_handle_frame_finish [bridge]) from [<7f2c8de4>] (br_handle_frame+0x16c/0x2c8 [bridge])
[ 168.718647] [<7f2c8de4>] (br_handle_frame [bridge]) from [<8060ba50>] (__netif_receive_skb_core+0x2ac/0xb28)
[ 168.718673] [<8060ba50>] (__netif_receive_skb_core) from [<8060ed54>] (process_backlog+0x120/0x210)
[ 168.718697] [<8060ed54>] (process_backlog) from [<806123e0>] (net_rx_action+0x320/0x59c)
[ 168.718722] [<806123e0>] (net_rx_action) from [<80037d0c>] (__do_softirq+0x1d4/0x4dc)
[ 168.718744] [<80037d0c>] (__do_softirq) from [<80038510>] (irq_exit+0x120/0x168)
[ 168.718770] [<80038510>] (irq_exit) from [<8009c87c>] (__handle_domain_irq+0x98/0xec)
[ 168.718796] [<8009c87c>] (__handle_domain_irq) from [<80009374>] (asm_do_IRQ+0x2c/0x30)
[ 168.718819] [<80009374>] (asm_do_IRQ) from [<80725b74>] (__irq_svc+0x34/0x14c)
[ 168.718832] Exception stack(0x809cbf10 to 0x809cbf58)
[ 168.718849] bf00: 00000001 00000000 00000000 00000000
[ 168.718869] bf20: 809ca000 809e8e18 809e8db8 80a4dc3c 00000000 00000000 8072afd8 809cbf64
[ 168.718887] bf40: 809e9d20 809cbf58 8001792c 80017930 600d0013 ffffffff
[ 168.718911] [<80725b74>] (__irq_svc) from [<80017930>] (arch_cpu_idle+0x34/0x4c)
[ 168.718937] [<80017930>] (arch_cpu_idle) from [<80084d30>] (cpu_startup_entry+0x324/0x428)
[ 168.718965] [<80084d30>] (cpu_startup_entry) from [<8071a8e0>] (rest_init+0x98/0x9c)
[ 168.718994] [<8071a8e0>] (rest_init) from [<80963ce0>] (start_kernel+0x388/0x394)
The bridge is created with this script:
#!/bin/bash
echo "Waiting for some time..."
sleep 120
systemctl stop connman
sleep 5
br="br0"
dev="eth0"
wlan="wlan0"
hostapd="/usr/sbin/hostapd"
config="/etc/hostapd/hostapd.conf"
# -----------------------------------------------------------------------------
# Move $dev to $br
ip4=$(ip addr show dev $dev | sed -e "s/ \+/ /g" -e "s/^ //g" | grep "^inet " | cut -d ' ' -f 2)
ip6=$(ip addr show dev $dev | sed -e "s/ \+/ /g" -e "s/^ //g" | grep "^inet6 " | cut -d ' ' -f 2)
rt=$(ip route show | sed -e "s/ \+/ /g" -e "s/^ //g" | grep ^default | grep " dev $dev")
if [ -z "$ip4" -a -z "$ip6" ]
then
echo >&2 "Cannot find either IPv4 or IPv6 IP on eth0."
exit 1
fi
echo "Adding the $br bridge..."
ip link add $br type bridge || exit 1
for ip in $ip4
do
echo "Adding IPv4 IP $ip to the $br bridge..."
ip -4 addr add $ip dev $br || exit 1
done
for ip in $ip6
do
echo "Adding IPv6 IP $ip to the $br bridge..."
ip -6 addr add $ip dev $br || exit 1
done
echo "Bringing the $br bridge UP..."
ip link set dev $br up || exit 1
echo "Adding $dev to the $br bridge..."
ip link set $dev master $br || exit 1
for ip in $ip4
do
echo "Deleting IPv4 IP $ip from $dev..."
ip -4 addr del $ip dev $dev
done
for ip in $ip6
do
echo "Deleting IPv6 IP $ip from $dev..."
ip -6 addr del $ip dev $dev
done
if [ ! -z "$rt" ]
then
rt=$(echo " $rt " | sed "s/ dev $dev / dev $br /g")
echo "Adding default gateway: $rt..."
ip route add $rt || ip route replace $rt
fi
# enable bridge STP
brctl stp br0 on
# -----------------------------------------------------------------------------
# add $wlan to $br
ip link set $wlan master $br
# make this bridge have the lowest possible priority
brctl setbridgeprio $br 65535
# -----------------------------------------------------------------------------
# enable wireless
rfkill unblock all
# -----------------------------------------------------------------------------
# run $hostapd
while [ 1 = 1 ]
do
echo
echo "Setting regulatory domain to GR"
iw reg set GR
echo
#echo "Setting txpower on ${wlan}"
iwconfig ${wlan} txpower 10dBm
echo "Starting hostapd..."
$hostapd -d $config
echo "hostapd exited. Waiting 1 sec..."
sleep 1
done # >/var/log/hostapd.log 2>&1
exit 0