From owner-freebsd-wireless@freebsd.org Fri Jul 6 21:36:14 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 C7C21102FD4B for ; Fri, 6 Jul 2018 21:36:13 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (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 605EB70927; Fri, 6 Jul 2018 21:36:13 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-io0-x229.google.com with SMTP id p7-v6so12029395ioh.13; Fri, 06 Jul 2018 14:36:13 -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=L2nwceatZQg569nckgxaPHbVI80NoUiHZix9RLmeAYc=; b=PkLoASEpOiUvBmHPf0jBlyoRsMU5MO2jKimVCdqnv7zh8AbseJgHshG5i4Vk3oFUjd 6qOjQH7lNcgFQOPELUJK4xnJBiGVOu1ZqGG4oDNoWtW4EpWTUVRvjDsNdUaD7/44s+yS OugS7x9hKZYnIrHaj0rpns89p2UHUu7UqjvfOLHTFCaHi4yXGMK7upSEtKD3e0dhvEyZ 1BrZnA8t/1SfT9t20TSP4TPgkUfjAuug2q9if0gSYpVAEXzlyfelEH6OiegOlEVMvgsd 8VXPAL1h9tr5idDMDJ6NY/w8x7ISwgtr36JWPzyx6E5+2tTkrPX2oiuqzvSvZgWVZKe5 kCng== 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=L2nwceatZQg569nckgxaPHbVI80NoUiHZix9RLmeAYc=; b=cPCmsK19JdZMF6yAEJtkYTtSH7E9QbkvZ6skfQ0ThOeYegdLiJ0Izj2mDM1kdg9CY+ 7eCjAc6zZi0+ZYV8xradhhB1GWlirxGJIQaBPbHGi2XRfUSPtDW8P45Dkr8uSDsFdNG4 zko+LS/dtYwCjmvKqh3EorgCXP7gs5eMhGmRiSjy8GNsSeBu1ajEcyG3aV+P/ebP1toY 8VaCwTDSmGIOCeO19KysKLrLEQ+1RErUHVFbk2z7m/BkCFPJcT3AhwcdXcN/Kp00EWNT QBoqCQQ6/DN+1jzLqfbW1ectst3NMrdQLCSjuZajyYoYtQcFHchfG30io4HmKAfsqz+b G49Q== X-Gm-Message-State: APt69E1bYgDt2oHLQq4eS/3f5TDqoOQANsX5mvnNo/7nPWzM1z6CXC1M iKmx9Znor/ASfnIvULKdYJqjrjpP8MjcI20FCIu4vw== X-Google-Smtp-Source: AAOMgpccWOH079FH+BIrl2kjMDFSgoSzVVV11zgCjJfuSP329t5l8fOotqVw99f/njXR3tCE3t9/NUK0lVwelWKZ5RA= X-Received: by 2002:a6b:6208:: with SMTP id f8-v6mr9862097iog.11.1530912972390; Fri, 06 Jul 2018 14:36:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:8101:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 14:35:51 -0700 (PDT) From: Farhan Khan Date: Fri, 6 Jul 2018 17:35:51 -0400 Message-ID: Subject: Where is rtwn(4) scan failing To: Kevin Lo , avos@freebsd.org, 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: Fri, 06 Jul 2018 21:36:14 -0000 Hi Kevin, Andriy, et al, As you know, I am working on expanding rtwn(4) to include the rtl8188ee driver. It appears that net80211(4) performs a scan before associating to a BSS, so I am working on scanning. When I run `ifconfig wlan0 scan`, sta_pick_bss() returns immediately without any listed networks suggesting that whatever happens in the driver is failing. It appears that the scanning method begins at rtwn_scan_start(). Using dtrace and manually tracing the source, I identified that the kernel executes the following non-net80211(4) methods: * rtwn_raw_xmit * r92c_fill_tx_desc_raw * r88ee_tx_setup_macid * r88ee_tx_setup_hwseq * rtwn_pci_tx_start_frame * r92ce_copy_tx_desc * r92ce_tx_postsetup * r92ce_dump_tx_desc First, can you please provide a conceptual overview of what is happening in these functions? Second, I am not certain which (or more than one?) are failing to function properly with the new driver. Any ideas? As you know, I am using the Linux rtlwifi code as documentation, but their code is extremely difficult to read. I suspect that FreeBSD's r92c_fill_tx_desc_raw is Linux's rtl92ce_tx_fill_desc, but as I said, the Linux code is extremely difficult to trace through. The rtl8188ee equivalent is rtl88ee_tx_fill_desc. I only noticed 1 difference thus far which I do not understand yet. I suspect somewhere a value is set to 0x1f which should be 0x3f or something of this nature. I was stuck on Rx for around some 6 months and while eventually got it, it would be nice to be a little more efficient with Tx :) Again, any assistance is greatly appreciated. Thank you! -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE