From owner-freebsd-wireless@freebsd.org Tue Jul 3 22:15:49 2018 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 396D3102DA12 for ; Tue, 3 Jul 2018 22:15:49 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C03F673B7A for ; Tue, 3 Jul 2018 22:15:48 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-io0-x243.google.com with SMTP id l25-v6so3113513ioh.12 for ; Tue, 03 Jul 2018 15:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vEf5QCMbrznnEz2onQZy3MSnr2bHu8iDa5JD30qdE3o=; b=TIIpSevwRnly6u6PTvnIxWZ4M5dNPEpcNOrD2V3P1mUQDrr/jpg0c65jK+txXBhau9 lrPMCmtiVXgArND53u7/oxkOcaSflIEnZV4sDiIOHRxYI3KaNCJjoYY8T2J+mirGuiXc w7ifeyB+g0GIvd1HeaRygSpfpvb+iFtB/ZYnLQz1Dl45zDxNDIpb/MHtDICGW15WcSsb A4p/8BUxV7nRkC3NEo1zaJE2twS7pmWejK9uLpymvIGSQ3VtgOUUGBzh5O3k8Oz0U0hT DBnk550oO1mw9gDEyh0PFbtBZL6gQYenUJSirgpAGgQyUCHkT8JOgxomYuuxsfGMw1Wa 7Oow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vEf5QCMbrznnEz2onQZy3MSnr2bHu8iDa5JD30qdE3o=; b=AS2DI7yHt1gDaw4SO85kGotfOMgEGMoODvwcCijKmJ1KPOmWW37faE7Js3iOuxacse hHoKuRbLRgSwkKKdiBZWt7gCdm06PFYN8/dPBNwVX3VPnkaFdJjC+jVwfqLDXjKs/TRh BRTQhwIAeGnIuVWeuOv90T5nOgCj7RVeT1Z+bz9chnjixVEMQvjKArlfhHuFUJJZi7Tv +0eJkBOnDo1Qh600GX05oZNVpz74KsH3uWdSp1B2QuPf28fn2QuG/y0Z/VKKFmsUGVPF x/hbPtnpnoegBbyLWeBVFEb9VlXGUFkBNN+Ujw6GajhqvoUSJ6+jrfmtplQSfB6tNs0K k/Gg== X-Gm-Message-State: APt69E1YjjL887+XzxI8ic7V8pQ/aLIjmgEt6/xY/51S2FVfQWihyFHY uuKhNdvg7fR+9uuPZCNZM9f/mMw2+nN5jOboCdIvU+Ny X-Google-Smtp-Source: AAOMgpd0aOVfsrUbXF2PprxtUHpJ5C4Lbctk88vA7LEhvjFqfS0W5nA9yq/miAy6PvJamMCtPR5FqmALIWLEYJS+Tlw= X-Received: by 2002:a5e:950d:: with SMTP id r13-v6mr2709701ioj.224.1530656147964; Tue, 03 Jul 2018 15:15:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:8101:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 15:15:27 -0700 (PDT) From: Farhan Khan Date: Tue, 3 Jul 2018 18:15:27 -0400 Message-ID: Subject: ifconfig scan returns no results - tracing rtwn(4)'s scanning execution flow To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.27 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, 03 Jul 2018 22:15:49 -0000 Hi all, I'm having trouble tracing the scanning code. My extension to rtl8188ee currently returns immediately after running 'ifconfig wlan0 scan' without any identified BSSes. I am not yet certain why and am trying to figure out why. I suspect something is immediately failing and immediately returning. However, my tracing the code makes it appear circular and I am not certain where ieee80211(9) reaches into the kernel to perform the scan. My understanding of process flow: * ieee80211_swscan_attach queues a task for scan_curchan_task. * scan_curchan_task runs ic->ic_set_channel (733) and then immediately scans the channel with ic->ic_scan_curchan (line 745) in ieee80211_scan_sw.c. * ic->ic_scan_curchan is a pointer to to rtwn_scan_curchan() in if_rtwn.c (line 287). * rtwn_scan_curchan() almost immediately runs sc->sc_scan_curchan(), which is itself a pointer to ic->ic_scan_curchan. That's circular. Where did I go wrong? If rtwn(4)'s scanning is performed by the kernel, where does it reach into the kernel? I am trying to figure out where the failure in the lack of results from "ifconfig wlan0 scan" originates from. (Oh, lest anyone asks, I have at least 3 WiFi APs immediatley by the test laptop specifically for this test :) Thank you, -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE