[LEDE-DEV] [PATCH v2 4/5] base-files, mac80211, broadcom-wl: plug-and-play wifi detection

Jonas Gorski jonas.gorski at gmail.com
Thu Oct 13 04:07:50 PDT 2016


On 12 October 2016 at 20:13, Christian Lamparter
<chunkeey at googlemail.com> wrote:
> Hello,
>
> On Wednesday, October 12, 2016 1:32:38 PM CEST Jonas Gorski wrote:
>> On 11 October 2016 at 13:37, Christian Lamparter
>> <chunkeey at googlemail.com> wrote:

(snip)

>> > diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
>> > index 91c9362..f320326 100644
>> > --- a/package/kernel/mac80211/Makefile
>> > +++ b/package/kernel/mac80211/Makefile
>> > @@ -1732,6 +1732,8 @@ define KernelPackage/cfg80211/install
>> >         $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
>> >         $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
>> >         $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
>> > +       $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
>>
>> Don't you also need to update /etc/hotplug.json to pass through
>> ieee80211 events?
> No need for that. It's already handled there by [0].
>
>   64                 [ "if",
>   65                         [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
>   66                         [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
>   67                 ]
>
> If the /etc/hotplug.d/ieee80211 directory exits, hotplug-call will
> look for scripts in the directory and execute them.

Ah indeed, that commit must have been flown past me. Thanks for pointing it out.

>> > +       $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/00-wifi-detect
>> >  endef
>> >
>> >  define KernelPackage/ipw2100/install
>> > diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
>> > index 253de40..44ba511 100644
>> > --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
>> > +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
>> > @@ -58,7 +58,14 @@ check_mac80211_device() {
>> >         [ "$phy" = "$dev" ] && found=1
>> >  }
>> >
>> > +detect_mac80211_unlock_trap() {
>> > +       lock -u /var/lock/wifi-detect-mac80211.lock
>> > +}
>> > +
>> >  detect_mac80211() {
>> > +       trap detect_mac80211_unlock_trap EXIT
>> > +       lock /var/lock/wifi-detect-mac80211.lock
>> > +

Just noticed, would broadcom and mac80211 detection running at the
same time ok? If not, the lock should probably the same for both.

>> >         devidx=0
>> >         config_load wireless
>> >         while :; do
>> > diff --git a/package/kernel/mac80211/files/mac80211.hotplug b/package/kernel/mac80211/files/mac80211.hotplug
>> > new file mode 100644
>> > index 0000000..581be3d
>> > --- /dev/null
>> > +++ b/package/kernel/mac80211/files/mac80211.hotplug
>> > @@ -0,0 +1,5 @@
>> > +#!/bin/sh
>> > +
>> > +[ "${ACTION}" = "add" ] && {
>> > +       /sbin/wifi detect
>>
>> You need to fork here, else you will get a deadlock with wifi drivers
>> that request firmware on interface up instead of probe time, e.g.
>> rt2x00-usb.
> Are you sure that the detect_mac80211 and friends actually do bring up
> the interfaces? From what I can tell, it's just iw phy info and a bit
> of readlink [1].
>
> Still, I can add a "/sbin/wifi config &" there.

Indeed, I tried to reproduce what I saw then and couldn't, so
disregard my comments here.


Regards
Jonas



More information about the Lede-dev mailing list