2009-03-23 23:04:47

by Martin Capitanio

[permalink] [raw]
Subject: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=EU)
seems to be working, but afterwards inserting the rtl8187 driver causes crash:

Linux version 2.6.29-rc8, at commit 59fcbddaff6f862cc1584b488866d9c4a5579085

[ 13.872135] cfg80211: Using static regulatory domain info
[ 13.872177] cfg80211: Regulatory domain: EU
[ 13.872209] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 13.872258] (2402000 KHz - 2482000 KHz @ 40000 KHz), (600 mBi, _2000_ mBm)
[ 13.872294] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 13.872329] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 13.872364] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 13.872399] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
[ 13.872434] (5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
...
[ 14.616725] rtl8187: 8187B chip detected.
[ 14.616781] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[ 14.616848] IP: [<ffffffffa01644d7>] wiphy_update_regulatory+0x287/0x310 [cfg80211]
[ 14.616914] PGD be1e7067 PUD be10f067 PMD 0
[ 14.616973] Oops: 0000 [#1] SMP
[ 14.617024] last sysfs file: /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9/dev
[ 14.617076] CPU 0
[ 14.617111] Modules linked in: snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss rtl8187(+) snd_seq_midi snd_rawmidi joydev mac80211 uvcvideo btusb snd_seq_midi_event snd_seq eeprom_93cx6 bluetooth evdev snd_timer snd_seq_device snd cfg80211 videodev v4l1_compat v4l2_compat_ioctl32 usbhid hid video output rfkill psmouse serio_raw soundcore snd_page_alloc pcspkr input_polldev ac battery button intel_agp iTCO_wdt iTCO_vendor_support shpchp pci_hotplug sd_mod crc_t10dif sr_mod cdrom sg pata_acpi r8169 mii uhci_hcd dm_mirror dm_region_hash dm_log dm_snapshot dm_mod thermal processor fan fuse
[ 14.617936] Pid: 1789, comm: modprobe Not tainted 2.6.29-rc8-mc29-01 #1 Satellite L300
[ 14.617982] RIP: 0010:[<ffffffffa01644d7>] [<ffffffffa01644d7>] wiphy_update_regulatory+0x287/0x310 [cfg80211]
[ 14.618047] RSP: 0018:ffff8800be0adba8 EFLAGS: 00010246
[ 14.618078] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffa0169a10
[ 14.618111] RDX: 0000000000004e20 RSI: 000000000025e720 RDI: 0000000000000000
[ 14.618146] RBP: ffff8800be0adc18 R08: 000000000053c550 R09: 0000000000000006
[ 14.618180] R10: 0000000000000001 R11: ffffffffa0169998 R12: 0000000000259900
[ 14.618214] R13: 000000000025c010 R14: 0000000000000006 R15: ffff8800bdd79c4c
[ 14.618248] FS: 00007fa2cdcea6e0(0000) GS:ffffffff8084f080(0000) knlGS:0000000000000000
[ 14.618295] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 14.618327] CR2: 0000000000000008 CR3: 00000000bd925000 CR4: 00000000000006e0
[ 14.618361] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 14.618395] DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
[ 14.618430] Process modprobe (pid: 1789, threadinfo ffff8800be0ac000, task ffff8800bcc6ac00)
[ 14.618478] Stack:
[ 14.618503] 0000000000000002 00263540be0adc88 0000000100260e30 ffff8800bdd78080
[ 14.618567] 0000000d00000000 ffff8800bdd78180 ffff8800bdd79d00 0000000065f51f72
[ 14.618661] 00000000000009b4 0000000000000044 ffff8800bdd78080 ffff8800bdd78000
[ 14.618778] Call Trace:
[ 14.618805] [<ffffffffa0163436>] wiphy_register+0x106/0x200 [cfg80211]
[ 14.618854] [<ffffffffa01f11cf>] ieee80211_register_hw+0x5f/0x400 [mac80211]
[ 14.618908] [<ffffffffa02534ef>] rtl8187_probe+0x5ec/0x7d5 [rtl8187]
[ 14.618953] [<ffffffff80343d89>] ? __sysfs_add_one+0x39/0xb0
[ 14.619007] [<ffffffffa024b7e0>] ? rtl8187_eeprom_register_read+0x0/0x90 [rtl8187]
[ 14.619066] [<ffffffffa024b5e0>] ? rtl8187_eeprom_register_write+0x0/0xa0 [rtl8187]
[ 14.619125] [<ffffffff804deefa>] usb_probe_interface+0xfa/0x280
[ 14.619171] [<ffffffff8049ace4>] driver_probe_device+0xc4/0x320
[ 14.619214] [<ffffffff8049af40>] ? __driver_attach+0x0/0xb0
[ 14.619257] [<ffffffff8049afeb>] __driver_attach+0xab/0xb0
[ 14.619299] [<ffffffff8049af40>] ? __driver_attach+0x0/0xb0
[ 14.619341] [<ffffffff8049a30b>] bus_for_each_dev+0x6b/0xa0
[ 14.619383] [<ffffffff8049aa21>] driver_attach+0x21/0x30
[ 14.619424] [<ffffffff804999fd>] bus_add_driver+0x15d/0x2a0
[ 14.619467] [<ffffffff8049b231>] driver_register+0x71/0x150
[ 14.619510] [<ffffffff804dec09>] usb_register_driver+0xa9/0x120
[ 14.619553] [<ffffffffa0259000>] ? rtl8187_init+0x0/0x20 [rtl8187]
[ 14.619596] [<ffffffffa025901e>] rtl8187_init+0x1e/0x20 [rtl8187]
[ 14.619639] [<ffffffff80209041>] _stext+0x41/0x170
[ 14.619681] [<ffffffff80263f28>] ? __blocking_notifier_call_chain+0x68/0x90
[ 14.619728] [<ffffffff80275715>] sys_init_module+0xb5/0x200
[ 14.619770] [<ffffffff8020c94b>] system_call_fastpath+0x16/0x1b
[ 14.619813] Code: 00 0f 8e 99 fe ff ff 89 f0 2b 41 0c 89 c2 c1 fa 1f 31 d0 29 d0 3d 80 84 1e 00 41 0f 9e c2 e9 7d fe ff ff 90 48 8b 05 d1 9a 00 00 <83> 78 08 04 74 64 83 4d cc 01 8b 45 cc 41 89 47 0c e9 2c ff ff
[ 14.620519] RIP [<ffffffffa01644d7>] wiphy_update_regulatory+0x287/0x310 [cfg80211]
[ 14.620578] RSP <ffff8800be0adba8>
[ 14.620606] CR2: 0000000000000008
[ 14.620694] ---[ end trace 6cd00e5f40edb2f1 ]---


without changing the regulatory domain:

[ 14.101092] cfg80211: Using static regulatory domain info
[ 14.101132] cfg80211: Regulatory domain: US
[ 14.101161] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 14.101207] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[ 14.101240] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.101273] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.101307] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.101340] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.101373] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[ 14.101406] cfg80211: Calling CRDA for country: US
...
[ 14.926271] rtl8187: 8187B chip detected.
[ 14.926489] wmaster0 (rtl8187): not using net_device_ops yet
[ 14.926822] phy0: Selected rate control algorithm 'minstrel'
[ 14.953454] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input9
[ 15.401956] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[ 15.402103] HDA Intel 0000:00:1b.0: setting latency timer to 64
[ 15.430230] wlan0 (rtl8187): not using net_device_ops yet
[ 15.430630] phy0: hwaddr , RTL8187BvE V0 + rtl8225z2
[ 15.430735] usbcore: registered new interface driver rtl8187
[ 16.804031] hda_intel: azx_get_response timeout, switching to polling mode: last cmd=0x003ba000
[ 16.863070] Adding 6144820k swap on /dev/sda6. Priority:-1 extents:1 across:6144820k
[ 21.000066] Clocksource tsc unstable (delta = -400111373 ns)

./iw list
Wiphy phy0
Band 1:
Frequencies:
* 2412 MHz [1] (27.0 dBm)
* 2417 MHz [2] (27.0 dBm)
* 2422 MHz [3] (27.0 dBm)
* 2427 MHz [4] (27.0 dBm)
* 2432 MHz [5] (27.0 dBm)
* 2437 MHz [6] (27.0 dBm)
* 2442 MHz [7] (27.0 dBm)
* 2447 MHz [8] (27.0 dBm)
* 2452 MHz [9] (27.0 dBm)
* 2457 MHz [10] (27.0 dBm)
* 2462 MHz [11] (27.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
Bitrates:
* 1.0 Mbps
* 2.0 Mbps
* 5.5 Mbps
* 11.0 Mbps
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Supported interface modes:
* Station
* Monitor




2009-03-24 03:00:20

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

On Tue, Mar 24, 2009 at 1:52 AM, Martin Capitanio <[email protected]> wrote:
> Am Montag, den 23.03.2009, 16:10 -0700 schrieb Luis R. Rodriguez:
>> On Mon, Mar 23, 2009 at 4:04 PM, Martin Capitanio <[email protected]> wrote:
>> > Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=EU)
>> > seems to be working, but afterwards inserting the rtl8187 driver causes crash:
>>
>> Please try with today's wireless-testing a set of fixes went in to
>
> Sure, I tried "DE" with the same result as well.
>
> Fortunately, wireless-testing doesn't crash during the rtl8187 driver load
> anymore, but changing the regulatory domain seems to be no-op (see below).
<snipped>

I have yesterday's compat-wireless (v2.6.29-rc8-18669-g77f1f84), and
setting EU seems to make it stop responding to setting anything else
(no more CRDA dmesg messages after the EU entry) - the driver is still
operational though...
will give today's wireless-testing a try :-).

cfg80211: Calling CRDA for country: DE
cfg80211: Regulatory domain changed to country: DE
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
(5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
(5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)
cfg80211: Calling CRDA for country: US
cfg80211: Regulatory domain changed to country: US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
(5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
(5490000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: EU

2009-03-24 07:38:15

by Johannes Berg

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

On Mon, 2009-03-23 at 23:34 -0500, Larry Finger wrote:

> commit 59fe3ee33bdb7e8dd0584271382fb94880f68002
> Author: Johannes Berg <[email protected]>
> Date: Sat Mar 21 17:08:43 2009 +0100
>
> mac80211: remove mixed-cell and userspace MLME code
>
> Neither can currently be set from userspace, so there's no
> regression potential, and neither will be supported from
> userspace since the new userspace APIs allow the SME, which
> is in userspace, to control all we need.
>
> Signed-off-by: Johannes Berg <[email protected]>
> Signed-off-by: John W. Linville <[email protected]>

Ouch. I suck. And the problem is blindingly obvious:


+ if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
+ return ieee80211_ibss_rx_mgmt(sdata, rx->skb, rx->status);

needs to be == of course!

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2009-03-23 23:10:26

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

On Mon, Mar 23, 2009 at 4:04 PM, Martin Capitanio <[email protected]> wrote:
> Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=EU)
> seems to be working, but afterwards inserting the rtl8187 driver causes crash:

Please try with today's wireless-testing a set of fixes went in to
address a bug with "EU". Mind you, "EU" is an invalid ISO3166-alpha2
so you may want to consider start using your own valid country alpha2
code. If you use "EU" now you'll world roam.

Luis

2009-03-24 04:34:50

by Larry Finger

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

Martin Capitanio wrote:
> Furthermore the current wireless-testing breaks the rtl8187 driver completely.
> If I try to connect to an AP (with or without changing the domain),
> it hard-freezes the kernel without any log entry.

The problem is more general than rtl8187. The system freezes when I try to
connect with rrtl8187 or b43. Using bisection, the bad commit is as follows:

======================================================

commit 59fe3ee33bdb7e8dd0584271382fb94880f68002
Author: Johannes Berg <[email protected]>
Date: Sat Mar 21 17:08:43 2009 +0100

mac80211: remove mixed-cell and userspace MLME code

Neither can currently be set from userspace, so there's no
regression potential, and neither will be supported from
userspace since the new userspace APIs allow the SME, which
is in userspace, to control all we need.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

============================================================

I have not yet tried to see which hunk or hunks cause the proble, but backing
oout that patch allows the system to work correctly.

Larry



2009-03-24 05:48:32

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

On Mon, Mar 23, 2009 at 6:52 PM, Martin Capitanio <[email protected]=
> wrote:
> Am Montag, den 23.03.2009, 16:10 -0700 schrieb Luis R. Rodriguez:
>> On Mon, Mar 23, 2009 at 4:04 PM, Martin Capitanio <martin@capitanio.=
org> wrote:
>> > Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=3D=
EU)
>> > seems to be working, but afterwards inserting the rtl8187 driver c=
auses crash:
>>
>> Please try with today's wireless-testing a set of fixes went in to
>
> Sure, I tried "DE" with the same result as well.
>
> Fortunately, wireless-testing doesn't crash during the rtl8187 driver=
load
> anymore, but changing the regulatory domain seems to be no-op (see be=
low).
>
> Furthermore the current wireless-testing breaks the rtl8187 driver co=
mpletely.
> If I try to connect to an AP (with or without changing the domain),
> it hard-freezes the kernel without any log entry.
>
>> address a bug with "EU". Mind you, "EU" is an invalid ISO3166-alpha2
>> so you may want to consider start using your own valid country alpha=
2
>> code. If you use "EU" now you'll world roam.
>
> I wonder why is there than the EU (confusing) code at all?

Its complete crap, in fact stop using the module parameter. "EU" is
part of the 3 static regulatory domains left from the old regulatory
implementation. It should have been removed eons ago but old habits
are hard to kill. Fortunately distributions are now shipping and with
OLD_REG disabled on 2.6.28 (both FC11 and Ubuntu Jaunty). The "EU"
option and even the ieee80211_regdom module parameter are simply not
an option in 2.6.28 and 2.6.29 if OLD_REG is disabled, we have a
suitable replacement -- a userspace call.

Unfortunately I just added the module parameter when OLD_REG is
disabled to try to remove OLD_REG completely but that didn't seem to
work yet.

> Actually I would expect a "smallest common intersection" of the 27 Eu=
ropean
> Union member states.

Heh, well its easier than that you get a ISO / IEC 3166 alpha2 for
each country. So you just pick your country. "EU" is an ancient
regulatory concoction, it should be ignored and forgotten.

> Martin
>
> ----
> 2.6.29-rc8-wl at commit 8fe80c672051978895d0c3ef7be1dc7bcaa8621e
>
> [ =C2=A0 14.724111] cfg80211: Using static regulatory domain info
> [ =C2=A0 14.724154] cfg80211: Regulatory domain: US

So, not all of my patches were applied... Specifically the one that
removed OLD_REG was not applied. This is why you are getting "US"
still as your default. You probably have OLD_REG enabled in your
kernel.

> [ =C2=A0 14.724186] =C2=A0(start_freq - end_freq @ bandwidth), (max_a=
ntenna_gain, max_eirp)
> [ =C2=A0 14.724233] =C2=A0(2402000 KHz - 2472000 KHz @ 40000 KHz), (6=
00 mBi, 2700 mBm)
> [ =C2=A0 14.724267] =C2=A0(5170000 KHz - 5190000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0 14.724300] =C2=A0(5190000 KHz - 5210000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0 14.724334] =C2=A0(5210000 KHz - 5230000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0 14.724367] =C2=A0(5230000 KHz - 5330000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0 14.724402] =C2=A0(5735000 KHz - 5835000 KHz @ 40000 KHz), (6=
00 mBi, 3000 mBm)
> [ =C2=A0 14.724453] cfg80211: Calling CRDA for country: US
> [ =C2=A0 14.731855] usbcore: registered new interface driver hiddev
> [ =C2=A0 14.734528] input: Logitech USB Receiver as /devices/pci0000:=
00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input6
> [ =C2=A0 14.744220] generic-usb 0003:046D:C526.0001: input,hidraw0: U=
SB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.0-1/input0
> [ =C2=A0 14.749224] input: Logitech USB Receiver as /devices/pci0000:=
00/0000:00:1d.0/usb5/5-1/5-1:1.1/input/input7
> [ =C2=A0 14.760185] generic-usb 0003:046D:C526.0002: input,hiddev0,hi=
draw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.0=
-1/input1
> [ =C2=A0 14.761508] usbcore: registered new interface driver usbhid
> [ =C2=A0 14.762406] usbhid: v2.6:USB HID core driver
> [ =C2=A0 14.785424] uvcvideo: Found UVC 1.00 device CNF7051 (04f2:b07=
0)
> [ =C2=A0 14.787514] input: CNF7051 as /devices/pci0000:00/0000:00:1a.=
7/usb1/1-2/1-2:1.0/input/input8
> [ =C2=A0 14.795375] Bluetooth: Generic Bluetooth USB driver ver 0.4
> [ =C2=A0 14.795520] usbcore: registered new interface driver btusb
> [ =C2=A0 14.874378] usbcore: registered new interface driver uvcvideo
> [ =C2=A0 14.874417] USB Video Class driver (v0.1.0)
> [ =C2=A0 15.384073] Synaptics Touchpad, model: 1, fw: 6.3, id: 0x9280=
b1, caps: 0xa04711/0xa04000
> [ =C2=A0 15.406636] rtl8187: 8187B chip detected.
> [ =C2=A0 15.407152] phy0: Selected rate control algorithm 'minstrel'
>
>
> modprobe -r rtl8187
> modprobe -r cfg80211
> modprobe cfg80211 ieee80211_regdom=3DDE
> [ =C2=A0570.676064] usbcore: deregistering interface driver rtl8187
> [ =C2=A0570.944071] usb 2-6: reset high speed USB device using ehci_h=
cd and address 4
> [ =C2=A0687.552176] cfg80211: Using static regulatory domain info
> [ =C2=A0687.552182] cfg80211: Regulatory domain: US
> [ =C2=A0687.552186] =C2=A0(start_freq - end_freq @ bandwidth), (max_a=
ntenna_gain, max_eirp)
> [ =C2=A0687.552191] =C2=A0(2402000 KHz - 2472000 KHz @ 40000 KHz), (6=
00 mBi, 2700 mBm)
> [ =C2=A0687.552196] =C2=A0(5170000 KHz - 5190000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0687.552201] =C2=A0(5190000 KHz - 5210000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0687.552206] =C2=A0(5210000 KHz - 5230000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0687.552210] =C2=A0(5230000 KHz - 5330000 KHz @ 40000 KHz), (6=
00 mBi, 2300 mBm)
> [ =C2=A0687.552215] =C2=A0(5735000 KHz - 5835000 KHz @ 40000 KHz), (6=
00 mBi, 3000 mBm)

So.. this still happens because within OLD_REG "DE" is not a valid
static regulatory domain, so first you get by default the "US" static
regulatory domain. That is -- if you want to use OLD_REG and get a
static regulatory domain applied by default first you only have 3
options:

"US"
"EU"
"JP"

Now this is pure garbage and which is why people should stop using
OLD_REG and forget about it.

> [ =C2=A0687.552501] cfg80211: Calling CRDA for country: DE

Strange well I just tested with OLD_REG and I get the same "US" crap
as above but then immediately after that I got "DE" as follows:

[15895.175144] cfg80211: Regulatory domain changed to country: DE
[15895.175189] (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[15895.175241] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm=
)
[15895.175274] (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm=
)
[15895.175312] (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm=
)

You probably don't have the wireless-regdb and crda installed. We have
offloaded all this regulatory information to userspace, you know get a
decent world roaming regulatory domain by default instead of assuming
everyone lives the United States. Then you can set the regulatory
domain.

http://wireless.kernel.org/download/wireless-regdb/
sudo make install

http://wireless.kernel.org/download/crda/
make
sudo make install

Then you should get your "DE".

> modprobe rtl8187
> [ =C2=A0731.873109] rtl8187: 8187B chip detected.
> [ =C2=A0731.877283] phy0: Selected rate control algorithm 'minstrel'
> [ =C2=A0731.877990] phy0: hwaddr , RTL8187BvE V0 + rtl8225z2
> [ =C2=A0731.878047] usbcore: registered new interface driver rtl8187
>
> iw reg get
> country US:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(2402 - 2472 @ 40), (6, 27)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5170 - 5190 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5190 - 5210 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5210 - 5230 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5230 - 5330 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5735 - 5835 @ 40), (6, 30)
>
> iw reg set DE
> iw reg get
> country US:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(2402 - 2472 @ 40), (6, 27)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5170 - 5190 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5190 - 5210 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5210 - 5230 @ 40), (6, 23)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0(5230 - 5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any panics, everything is as expected --except my removal
of OLD_REG patch was not applied.

Luis

2009-03-24 13:55:49

by Martin Capitanio

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

On Mon, 2009-03-23 at 22:48 -0700, Luis R. Rodriguez wrote:
> On Mon, Mar 23, 2009 at 6:52 PM, Martin Capitanio <[email protected]> wrote:
> > Am Montag, den 23.03.2009, 16:10 -0700 schrieb Luis R. Rodriguez:
> >> On Mon, Mar 23, 2009 at 4:04 PM, Martin Capitanio <[email protected]> wrote:
> >> > Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=EU)
> >> > seems to be working, but afterwards inserting the rtl8187 driver causes crash:
> >>
> >> Please try with today's wireless-testing a set of fixes went in to
> >
> > Sure, I tried "DE" with the same result as well.
> >
> > Fortunately, wireless-testing doesn't crash during the rtl8187 driver load
> > anymore, but changing the regulatory domain seems to be no-op (see below).
> >
> > Furthermore the current wireless-testing breaks the rtl8187 driver completely.
> > If I try to connect to an AP (with or without changing the domain),
> > it hard-freezes the kernel without any log entry.
> >
> >> address a bug with "EU". Mind you, "EU" is an invalid ISO3166-alpha2
> >> so you may want to consider start using your own valid country alpha2
> >> code. If you use "EU" now you'll world roam.
> >
> > I wonder why is there than the EU (confusing) code at all?
>
> Its complete crap, in fact stop using the module parameter. "EU" is
> part of the 3 static regulatory domains left from the old regulatory
> implementation. It should have been removed eons ago but old habits
> are hard to kill. Fortunately distributions are now shipping and with
> OLD_REG disabled on 2.6.28 (both FC11 and Ubuntu Jaunty). The "EU"
> option and even the ieee80211_regdom module parameter are simply not
> an option in 2.6.28 and 2.6.29 if OLD_REG is disabled, we have a
> suitable replacement -- a userspace call.
>
> Unfortunately I just added the module parameter when OLD_REG is
> disabled to try to remove OLD_REG completely but that didn't seem to
> work yet.
>
> > Actually I would expect a "smallest common intersection" of the 27 European
> > Union member states.
>
> Heh, well its easier than that you get a ISO / IEC 3166 alpha2 for
> each country. So you just pick your country. "EU" is an ancient
> regulatory concoction, it should be ignored and forgotten.
>

Full ACK from the user POW. If the hid maintainers had a fraction
of your enthusiasm and pulled the "funny keys" quirk monstrosity to the
userspace ...

> > 2.6.29-rc8-wl at commit 8fe80c672051978895d0c3ef7be1dc7bcaa8621e
> >
> > [ 14.724111] cfg80211: Using static regulatory domain info
> > [ 14.724154] cfg80211: Regulatory domain: US
>
> So, not all of my patches were applied... Specifically the one that
> removed OLD_REG was not applied. This is why you are getting "US"
> still as your default. You probably have OLD_REG enabled in your
> kernel.

Yes, fgrep OLD_REG /boot/config-2.6.29-rc8-wl
CONFIG_WIRELESS_OLD_REGULATORY=y

The make oldconfig did it ;-)

...
> > modprobe -r rtl8187
> > modprobe -r cfg80211
> > modprobe cfg80211 ieee80211_regdom=DE
> > [ 570.676064] usbcore: deregistering interface driver rtl8187
> > [ 570.944071] usb 2-6: reset high speed USB device using ehci_hcd and address 4
> > [ 687.552176] cfg80211: Using static regulatory domain info
> > [ 687.552182] cfg80211: Regulatory domain: US
> > [ 687.552186] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
> > [ 687.552191] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
> > [ 687.552196] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
> > [ 687.552201] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
> > [ 687.552206] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
> > [ 687.552210] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
> > [ 687.552215] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
>
> So.. this still happens because within OLD_REG "DE" is not a valid
> static regulatory domain, so first you get by default the "US" static
> regulatory domain. That is -- if you want to use OLD_REG and get a
> static regulatory domain applied by default first you only have 3
> options:
>
> "US"
> "EU"
> "JP"
>
> Now this is pure garbage and which is why people should stop using
> OLD_REG and forget about it.

Hmm, there is a lot bogus information or howtos on the web.
Somebody probably should incorporate exactly this information
on the web-page http://linuxwireless.org/en/developers/Regulatory
E.g. I didn't know what "static regulatory domain" really means.

>
> > [ 687.552501] cfg80211: Calling CRDA for country: DE
>
> Strange well I just tested with OLD_REG and I get the same "US" crap
> as above but then immediately after that I got "DE" as follows:
>
> [15895.175144] cfg80211: Regulatory domain changed to country: DE
> [15895.175189] (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [15895.175241] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
> [15895.175274] (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
> [15895.175312] (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)
>
> You probably don't have the wireless-regdb and crda installed. We have
> offloaded all this regulatory information to userspace, you know get a
> decent world roaming regulatory domain by default instead of assuming
> everyone lives the United States. Then you can set the regulatory
> domain.
>
> http://wireless.kernel.org/download/wireless-regdb/
> sudo make install
>
> http://wireless.kernel.org/download/crda/
> make
> sudo make install

Thanks! The udev rule was not activated. (Maybe
the install target could check if the /etc/udev/rules.d/
directory eixst before installing it somewhere else)

As it is, wireless-testing works now (OLD_REGULATORY disabled):

[ 14.582317] cfg80211: World regulatory domain updated:
[ 14.582362] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 14.583219] (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 14.583264] (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 14.583299] (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 14.583352] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 14.583394] (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
...
iw list
Wiphy phy0
Band 1:
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
...
iw reg get
country 00:
(2402 - 2472 @ 40), (3, 20)
(2457 - 2482 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS
(2474 - 2494 @ 20), (3, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
(5170 - 5250 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
(5735 - 5835 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS

iw reg set DE
iw reg get
country DE:
(2400 - 2483 @ 40), (N/A, 20)
(5150 - 5255 @ 40), (N/A, 23), NO-OUTDOOR, DFS
(5470 - 5650 @ 40), (N/A, 30), DFS

iw list
Wiphy phy0
Band 1:
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (disabled)
...
[ 502.786782] cfg80211: Calling CRDA for country: DE
[ 502.793085] cfg80211: Regulatory domain changed to country: DE
[ 502.793095] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 502.793100] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 502.793105] (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
[ 502.793109] (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)
[ 752.221876] cfg80211: Calling CRDA to update world regulatory domain
[ 752.227562] cfg80211: Enabling active scanning on frequency: 2472 MHz (Ch 13) on phy0
[ 752.227570] cfg80211: Enabling beaconing on frequency: 2472 MHz (Ch 13) on phy0
[ 752.227574] cfg80211: World regulatory domain updated:
[ 752.227578] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 752.227584] (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 752.227589] (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 752.227594] (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 752.227598] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 752.227603] (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 787.947893] cfg80211: Calling CRDA for country: DE
[ 787.953490] cfg80211: Regulatory domain changed to country: DE
[ 787.953498] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 787.953503] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 787.953508] (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
[ 787.953512] (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)
...
> I don't see any panics, everything is as expected --except my removal
> of OLD_REG patch was not applied.

As Johannes wrote, the problem is blindingly obvious ;-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index eff59f3..64ebe66 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1884,7 +1884,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
if (ieee80211_vif_is_mesh(&sdata->vif))
return ieee80211_mesh_rx_mgmt(sdata, rx->skb, rx->status);

- if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
+ if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
return ieee80211_ibss_rx_mgmt(sdata, rx->skb, rx->status);

if (sdata->vif.type == NL80211_IFTYPE_STATION)

I did some unscientific throughput measurements (WPA2/AES connection,
the AP says 54 MBit/s). Although this probably doesn't yet stop Balmers
monkey dancing, I see an _huge jump forwards_ compared to
the 2.6.27 / 2.6.28 code:

NETIO - Network Throughput Benchmark, Version 1.26
2.6.27 / 2.6.28:
TCP connection established.
Packet size 1k bytes: 377 KByte/s Tx, 795 KByte/s Rx.
Packet size 2k bytes: 392 KByte/s Tx, 739 KByte/s Rx.
Packet size 4k bytes: 371 KByte/s Tx, 782 KByte/s Rx.
Packet size 8k bytes: 381 KByte/s Tx, 759 KByte/s Rx.
Packet size 16k bytes: 383 KByte/s Tx, 765 KByte/s Rx.
Packet size 32k bytes: 384 KByte/s Tx, 810 KByte/s Rx.

wireless-testing / 2.6.29:
TCP connection established.
Packet size 1k bytes: 889 KByte/s Tx, 1109 KByte/s Rx.
Packet size 2k bytes: 1207 KByte/s Tx, 1032 KByte/s Rx.
Packet size 4k bytes: 1174 KByte/s Tx, 1106 KByte/s Rx.
Packet size 8k bytes: 1149 KByte/s Tx, 1138 KByte/s Rx.
Packet size 16k bytes: 1149 KByte/s Tx, 980 KByte/s Rx.
Packet size 32k bytes: 1119 KByte/s Tx, 1217 KByte/s Rx.

$vista$:
TCP connection established.
Packet size 1k bytes: 2746 KByte/s Tx, 3278 KByte/s Rx.
Packet size 2k bytes: 2786 KByte/s Tx, 3229 KByte/s Rx.
Packet size 4k bytes: 2554 KByte/s Tx, 3248 KByte/s Rx.
Packet size 8k bytes: 2850 KByte/s Tx, 3281 KByte/s Rx.
Packet size 16k bytes: 2865 KByte/s Tx, 3271 KByte/s Rx.
Packet size 32k bytes: 2673 KByte/s Tx, 3248 KByte/s Rx.

However iwconfig doesn't show the connection rate now:
wlan0 IEEE 802.11bg ESSID:"xx"
Mode:Managed Frequency:2.447 GHz Access Point: xx
Bit Rate=1 Mb/s Tx-Power=20 dBm
??????
Retry min limit:7 RTS thr:off Fragment thr=2352 B
Encryption key:xx [3] Security mode:open
Power Management:off
Link Quality=70/70 Signal level=-37 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

iwconfig -v
iwconfig Wireless-Tools version 29
Compatible with Wireless Extension v11 to v22.

Kernel Currently compiled with Wireless Extension v22.

wlan0 Recommend Wireless Extension v21 or later,
Currently compiled with Wireless Extension v22.

iw dev wlan0 scan dump
BSS xx (on wlan0)
TSF: 4126925365 usec (0d, 01:08:46)
freq: 2447
beacon interval: 100
capability: 0x0411
signal: -38.00 dBm
SSID: xx
Supported rates: 1.0* 2.0* 5.5* 11.0*
DS Parameter set: channel 8
Extended supported rates: 6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0

2.6.27/2.6.28:
wlan0 IEEE 802.11bg ESSID:"xx"
Mode:Managed Frequency:2.447 GHz Access Point: xx
Bit Rate=54 Mb/s Tx-Power=27 dBm
Retry min limit:7 RTS thr:off Fragment thr=2352 B
Encryption key:xx [2] Security mode:open
Power Management:off
Link Quality=60/100 Signal level:-41 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Martin


2009-03-24 01:52:22

by Martin Capitanio

[permalink] [raw]
Subject: Re: [BUG] rtl8187, cfg80211 - unable to handle kernel NULL pointer dereference

Am Montag, den 23.03.2009, 16:10 -0700 schrieb Luis R. Rodriguez:
> On Mon, Mar 23, 2009 at 4:04 PM, Martin Capitanio <[email protected]> wrote:
> > Setting the EU or DE regulatory domain (cfg80211 ieee80211_regdom=EU)
> > seems to be working, but afterwards inserting the rtl8187 driver causes crash:
>
> Please try with today's wireless-testing a set of fixes went in to

Sure, I tried "DE" with the same result as well.

Fortunately, wireless-testing doesn't crash during the rtl8187 driver load
anymore, but changing the regulatory domain seems to be no-op (see below).

Furthermore the current wireless-testing breaks the rtl8187 driver completely.
If I try to connect to an AP (with or without changing the domain),
it hard-freezes the kernel without any log entry.

> address a bug with "EU". Mind you, "EU" is an invalid ISO3166-alpha2
> so you may want to consider start using your own valid country alpha2
> code. If you use "EU" now you'll world roam.

I wonder why is there than the EU (confusing) code at all?
Actually I would expect a "smallest common intersection" of the 27 European
Union member states.

Martin

----
2.6.29-rc8-wl at commit 8fe80c672051978895d0c3ef7be1dc7bcaa8621e

[ 14.724111] cfg80211: Using static regulatory domain info
[ 14.724154] cfg80211: Regulatory domain: US
[ 14.724186] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 14.724233] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[ 14.724267] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.724300] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.724334] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.724367] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 14.724402] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[ 14.724453] cfg80211: Calling CRDA for country: US
[ 14.731855] usbcore: registered new interface driver hiddev
[ 14.734528] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input6
[ 14.744220] generic-usb 0003:046D:C526.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.0-1/input0
[ 14.749224] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/input/input7
[ 14.760185] generic-usb 0003:046D:C526.0002: input,hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.0-1/input1
[ 14.761508] usbcore: registered new interface driver usbhid
[ 14.762406] usbhid: v2.6:USB HID core driver
[ 14.785424] uvcvideo: Found UVC 1.00 device CNF7051 (04f2:b070)
[ 14.787514] input: CNF7051 as /devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.0/input/input8
[ 14.795375] Bluetooth: Generic Bluetooth USB driver ver 0.4
[ 14.795520] usbcore: registered new interface driver btusb
[ 14.874378] usbcore: registered new interface driver uvcvideo
[ 14.874417] USB Video Class driver (v0.1.0)
[ 15.384073] Synaptics Touchpad, model: 1, fw: 6.3, id: 0x9280b1, caps: 0xa04711/0xa04000
[ 15.406636] rtl8187: 8187B chip detected.
[ 15.407152] phy0: Selected rate control algorithm 'minstrel'


modprobe -r rtl8187
modprobe -r cfg80211
modprobe cfg80211 ieee80211_regdom=DE
[ 570.676064] usbcore: deregistering interface driver rtl8187
[ 570.944071] usb 2-6: reset high speed USB device using ehci_hcd and address 4
[ 687.552176] cfg80211: Using static regulatory domain info
[ 687.552182] cfg80211: Regulatory domain: US
[ 687.552186] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 687.552191] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[ 687.552196] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 687.552201] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 687.552206] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 687.552210] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[ 687.552215] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[ 687.552501] cfg80211: Calling CRDA for country: DE

modprobe rtl8187
[ 731.873109] rtl8187: 8187B chip detected.
[ 731.877283] phy0: Selected rate control algorithm 'minstrel'
[ 731.877990] phy0: hwaddr , RTL8187BvE V0 + rtl8225z2
[ 731.878047] usbcore: registered new interface driver rtl8187

iw reg get
country US:
(2402 - 2472 @ 40), (6, 27)
(5170 - 5190 @ 40), (6, 23)
(5190 - 5210 @ 40), (6, 23)
(5210 - 5230 @ 40), (6, 23)
(5230 - 5330 @ 40), (6, 23)
(5735 - 5835 @ 40), (6, 30)

iw reg set DE
iw reg get
country US:
(2402 - 2472 @ 40), (6, 27)
(5170 - 5190 @ 40), (6, 23)
(5190 - 5210 @ 40), (6, 23)
(5210 - 5230 @ 40), (6, 23)
(5230 - 5330 @ 40), (6, 23)
(5735 - 5835 @ 40), (6, 30)


iw list
Wiphy phy0
Band 1:
Frequencies:
* 2412 MHz [1] (27.0 dBm)
* 2417 MHz [2] (27.0 dBm)
* 2422 MHz [3] (27.0 dBm)
* 2427 MHz [4] (27.0 dBm)
* 2432 MHz [5] (27.0 dBm)
* 2437 MHz [6] (27.0 dBm)
* 2442 MHz [7] (27.0 dBm)
* 2447 MHz [8] (27.0 dBm)
* 2452 MHz [9] (27.0 dBm)
* 2457 MHz [10] (27.0 dBm)
* 2462 MHz [11] (27.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
Bitrates:
* 1.0 Mbps
* 2.0 Mbps
* 5.5 Mbps
* 11.0 Mbps
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
max # scan SSIDs: 4
Supported interface modes:
* Station
* Monitor