From owner-freebsd-hackers@freebsd.org Wed Jun 10 05:26:03 2020 Return-Path: Delivered-To: freebsd-hackers@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 A55B8329346; Wed, 10 Jun 2020 05:26:03 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 49hb7G3Kszz4hQt; Wed, 10 Jun 2020 05:26:02 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: by mail-lf1-x12d.google.com with SMTP id j12so709740lfh.0; Tue, 09 Jun 2020 22:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=LSerhDbvas11IA2kErUrzbds/Q110lc2O/L4COVGu0E=; b=egIqsIPrtFaDBpfqLhkOyGG3OKCoNivKWGnrg8x9O94X+7BxqDDA7ODpcM/4Pptwze MrscV7QI8YGGRtSQR8ENg+uuS+xkQr2EEK84LMRctKwwy6L3l4ezvtnwqDiK0lcoyJPi PrMbheuA4TeHe310EP89f4RNrzssMs1cWFRTcJq1Lm/Yctmt3SJyh4Gg0U/wAcxg6Dme 3uHF2fgkeGuZCxT5zJkE1XByNWMnZxELUfxjN5B6l/qCrQK0QbHfgxDJEpEjoMPWT2O6 5R+OoV1CfzSXwGbB6ELt/KSe9N1HNSapKgvjC12A5SjOnJwbmtqORFGhHBLykGht79p2 /gfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=LSerhDbvas11IA2kErUrzbds/Q110lc2O/L4COVGu0E=; b=Wzb+nb87y1JJzG4lpWWLKxejHThx/dlMJlq70RXP6E/sangZmmZXKLgcjlZLselG+o IlJA9LetLlr7SwXnoC2OGntI6te9bjecRzY+Fp2noexnuhsP/nY5+BcF1n9YfQCDdA5/ g0pmKnSvBukTRRff1zHzsx4SbBE7XtqiH/kTzjhtermkHl4XROEJcfwc6GLj80tQgIzO LGgSuR0TrnLz6JmB31+OjVEqMFcZcl3he7E4xKMhbr/aLaqQ4JkHXMsCxyvMujMG9v8W 1iciy1hXrqYJRC40/TbOLM72xitbAHJje3/bLhiBuFKeNETB0Dj+oF8jHwLlTrg/vSbe mOTg== X-Gm-Message-State: AOAM531OK32Wfjy+jPzx+xMj5GVsj2zF9QqTwSf/E418JOQQY6E1VTmP oF8VGIGCLtl3zGjXELcvqVllL5i2d8Q= X-Google-Smtp-Source: ABdhPJyP8djsbPU2BJlAftwIwkRke3KYkXzP5/h2QKp9D4tNxLmKKbKyr6as1+WKZinToBXV9b8YGw== X-Received: by 2002:a05:6512:7b:: with SMTP id i27mr743138lfo.30.1591766758848; Tue, 09 Jun 2020 22:25:58 -0700 (PDT) Received: from rimwks ([2001:470:1f15:3d8:7285:c2ff:fe37:5722]) by smtp.gmail.com with ESMTPSA id w20sm4715273ljo.68.2020.06.09.22.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 22:25:57 -0700 (PDT) From: Rozhuk Ivan X-Google-Original-From: Rozhuk Ivan Date: Wed, 10 Jun 2020 08:25:52 +0300 To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Cc: Rozhuk Ivan Subject: WiFi with AC on FreeBSD Message-ID: <20200610082552.0e08045c@rimwks> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49hb7G3Kszz4hQt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=egIqsIPr; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rozhukim@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=rozhukim@gmail.com X-Spamd-Result: default: False [-3.61 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.19)[-1.190]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.887]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.03)[-1.033]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::12d:from]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 05:26:03 -0000 Hi! For peoples who want to use linux WiFi drivers on FreeBSD with minimum support overhead :) This "how-to" (draft) describes how to use OpenWRT as driver with web GUI for WiFi adapters. No more pain with slow speed, no strange wpa_supplicant gui tools :) This upgrades WiFi speed from media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11a to 866Mbps on my notebook with intel 8265. Resourses required: - 256 Mb ram - 128 Mb on hard drive - IOMMU support - FreeBSD AMD64 1. Download EFI based build. WWW: https://openwrt.org/docs/guide-developer/uefi-bootable-image cd /root/ fetch https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-x86-64-generic-squashfs-combined-efi.img.gz gunzip openwrt-x86-64-generic-squashfs-combined-efi.img.gz 2. Install sysutils/bhyve-firmware from ports. CSM not required. Patch required to build port (last attached): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211074 3. Configure system: WWW: https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html https://wiki.freebsd.org/bhyve/pci_passthru echo 'net.link.tap.up_on_open=1' >> /etc/sysctl.conf /etc/rc.conf: kld_list="nmdm vmm" cloned_interfaces="tap0" ifconfig_tap0_name="wifi0" ifconfig_wifi0="DHCP up" ifconfig_wifi0_ipv6="inet6 accept_rtadv auto_linklocal -ifdisabled" /boot/loader.conf # bhyve PCI device passthru. # "1/0/0" - PCI dev ident, see: pciconf -lv pptdevs="1/0/0" # For AMD systems hw.vmm.amdvi.enable="1" 4. Start OpenWRT /usr/sbin/bhyvectl --destroy --vm=owrt /usr/sbin/bhyve \ -A \ -H \ -c 2 \ -m 256M \ -S \ -s 0:0,hostbridge \ -s 1:0,lpc -l com1,stdio \ -s 3:0,ahci-hd,openwrt-x86-64-generic-squashfs-combined-efi.img \ -s 5:0,e1000,tap0,mac=00:be:fa:76:45:01 \ -s 7,passthru,1/0/0 \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ owrt To disable output remove: "-l com1,stdio" "1/0/0" - PCI dev ident, same as in loader.conf. 5. Configure OpenWRT: uci set network.lan.ipaddr='172.16.0.49' uci set network.lan.netmask='255.255.255.0' uci set network.lan.gateway='172.16.0.254' uci add_list network.lan.dns='172.16.0.254' uci commit network /etc/init.d/network restart opkg update opkg install luci Now web GUI can be used to install wpad*, hostapd*, WiFi driver and other staff. If you want use OpenWRT as bridge - read this: https://openwrt.org/docs/guide-user/network/wifi/relay_configuration Better to start with simple rourer+nat mode.