From owner-freebsd-wireless@freebsd.org Tue May 19 23:11:36 2020 Return-Path: Delivered-To: freebsd-wireless@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 625292F7B6A for ; Tue, 19 May 2020 23:11:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49RWpv6rjyz4Gvy for ; Tue, 19 May 2020 23:11:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id EB1E22F7E02; Tue, 19 May 2020 23:11:35 +0000 (UTC) Delivered-To: wireless@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAEB72F7BBC for ; Tue, 19 May 2020 23:11:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RWpv5ry6z4GpY; Tue, 19 May 2020 23:11:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qk1-x742.google.com with SMTP id f13so1819822qkh.2; Tue, 19 May 2020 16:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qabhDJfwIC75pAGpEX+GdxNeC8iu8Kl7SCrybP43k5g=; b=ZFkIuqtlbrstrbN3VCuxNSRl3MMoMFNiUyTkgFUL8ku0+t6cabeh5EwTFdgcERAqF1 lvd3fB4sNVjyIGVnJNF9QKhwI+1Z1rulAbcqtG4YUC12QYLIIxVofT0dpWyKXFFN68Wc bJMxrYRknvzPc+Fy+xmEks30w31FArel1GjdC1QBZ89i8+DihKcbRjDC6Kbpu4z7BscV Em2icpv7EFrPuka36Agd56wTvTUjhzZCEHIDZbH0JnFuChGkLCUTY7LiAZKv2H3FUd9M gL568ScUUqhng0quzz0RAK90tQ85j3lupZmiAV3hJaLdm/JZjpCxHpVArO9fic7xqOg1 zmNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qabhDJfwIC75pAGpEX+GdxNeC8iu8Kl7SCrybP43k5g=; b=smnSzm3PXn5eda0PKTl9L6DZFvz6ywh6eaBon2Iph6wGmpyPBc1xoACx7d62dqXoqV EZG8+Ngbv/hniruVi7NBC122wPZI9uflzmuQRSckVGcpiaiqRIZtQYSwRk5PXRNJXcLe kmnwW8Q0Ca8JgaaNFI04jM2A7taZVAxUR/XkQ1es+sQcVaft0qLkYXWaMYak9TIyELKK wA/HOkAg1crgLNVfeTmHu/vALNPW39cv+yECbzSi+Ip+mti6RsCLK+PLYmiKZfiJzkCD DsD7kKsFOlav/dZypdebmVy6XNhgqtbL0y/jFNt1Ppy0nQia5C/prc1x/FXziL5PEfjG tEng== X-Gm-Message-State: AOAM533H1pnDlfNvBzKNKuQQbN9kEO74NryyyaOn7q22OAQhvjeuRs2Y DWwzsYYnoKe9gaiw3EYF7Eb8JD8g8ehKddILMmO4RQ== X-Google-Smtp-Source: ABdhPJz8TGp/kAx2pAdc4vH8NSwDtbL5YvVnnf+oy8cPU+DSNhx5EudfEsfJ70WvTd1PoulpSQGoGEF9aASetY6chjY= X-Received: by 2002:a37:6690:: with SMTP id a138mr1968824qkc.152.1589929893098; Tue, 19 May 2020 16:11:33 -0700 (PDT) MIME-Version: 1.0 References: <15021eed-2d82-5391-0edc-8d328e3ba31d@FreeBSD.org> <9d55db0d-fe7a-2695-ac3e-6668eab43622@FreeBSD.org> In-Reply-To: From: Adrian Chadd Date: Tue, 19 May 2020 16:11:19 -0700 Message-ID: Subject: Re: iwm rfkill To: Andriy Gapon Cc: "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49RWpv5ry6z4GpY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 23:11:36 -0000 On Tue, 19 May 2020 at 16:07, Andriy Gapon wrote: > > > > Adrian, thank you very much for your suggestion. > > Being a complete noob in this area, this is my stab at it: > > https://reviews.freebsd.org/D24923 > > Also, I see that there is some friction between how rfkill is handled at the > driver / kernel level and how it gets (or doesn't get) known to userland. > First, at least Intel wireless drivers use ieee80211_suspend_all / > ieee80211_resume_all KPI when handling rfkill. Those calls end up clearing or > setting IFF_DRV_RUNNING while userland mostly checks for IFF_UP. But that's not > an issue actually -- I think that it's userland code that needs fixing. The > issue is that the IFF_DRV_RUNNING changes become known to userland only by > accident if at all. Ha! Ok. > > Specifically, if we consider wpa_supplicant, it listens for notifications coming > via PF_ROUTE socket such as RTM_IFINFO. So, wpa_supplicant depends on (a) a > notification getting generated in the first place; (b) the notification > conveying correct information about an interface's state. > As far as I can tell, net80211 layer does not try to do either of the above. > E.g., in the case of ieee80211_stop_locked there is an RTM_IFINFO notification > because of a link status change, but that notification by the state change > that's performed before IFF_DRV_RUNNING is cleared. > In the case of ieee80211_start_locked the situation is even worse. > > I wonder if ieee80211 should explicitly use rt_ifmsg() to post right > notifications at right times. > FWIW, I already have a patch for that and it seems to work. Yes. :-) Let's get that in too. -a > > > -- > Andriy Gapon