From owner-freebsd-wireless@freebsd.org Fri Dec 6 08:31:55 2019 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 731281C5746 for ; Fri, 6 Dec 2019 08:31:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 47Tm612yPwz49qW for ; Fri, 6 Dec 2019 08:31:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id s8so6450650qte.2 for ; Fri, 06 Dec 2019 00:31:53 -0800 (PST) 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=J7V0PotzHaohYjqIqkjC5cvUs+curS4MQRLfrBZ3Nig=; b=PTWwd2a+vI82F++XRADHQnG8GjgasT4FtTSGukMzg+O7UgCw+/CnbeMSnKnxTVU7Uh MOv5VTBXhBQSvu9fXh6y0rZ0d90hAit4lSrquW/8siVydRHDoINSETHv6fmnJ1XhANt2 gPHkmCd/k+GJWEDMqwjWUVhOXjPhN1WrgQQA1KUn3hRhKW4ufiDyKyEz3Ai4vfgaEK+B hqWa3/6i0R+HBudI9th72wPDiqrRLBExgXFMlMHWgyJXth+TTy6T+3CNenl2ClIxxix1 P1QaZIwPqRg1H52IRuMbNrEj1LjRJ6QuvtIarrrW4/y4d+Uhq56xde2r3mtOPQWoJ4IA 5zMA== 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=J7V0PotzHaohYjqIqkjC5cvUs+curS4MQRLfrBZ3Nig=; b=SMpGwBpHtFExMN+jamNZ6ynL4iPl/DEjdTEP1zESgoMfjhh89kOP17J6wx1INpyXOo U/c/Pf/KXM3vVQgpev0ByGE8jL65WPbPzguYcDPrAn/M64cwcGrXXqCKw/NSCrG6OmCp 9agBE1Rx9rrrnOPgOk2VlVYMa/YQEysKEbb3sJmCDpLUB2BNIWKFzDZu8QuAtfvgNp8h mHBmtkVXeo9EeOeCIrt0e39PDcrokarMrCP7OH8PtvOcx8vw601vpQZAAezo/pUgxXeG hNwzluZH0OtbisRHd2hRb5ZpoRSHasz+1KpLN/dLBSYhSDMvK5HRQk48Jd6IT0PTj+ay RdIg== X-Gm-Message-State: APjAAAU0tstredS3NSn0Olni7B8LF9aVd2H3b6wAbLyTL8E/8dpZJM40 X3C7LaAfyPVyzbkx0lC96TWW/c2UuauLb9aKv1o= X-Google-Smtp-Source: APXvYqzaDeNVWWRAsv9EQvhjKBm9qKq7K/uBpoft+4ER/vXDHsAXl84/+83bCUK06Jw9vJJYSKSsh9y18oN4RL/CRho= X-Received: by 2002:ac8:7157:: with SMTP id h23mr11685785qtp.223.1575621112114; Fri, 06 Dec 2019 00:31:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Chadd Date: Fri, 6 Dec 2019 00:31:39 -0800 Message-ID: Subject: Re: Regarding Chipset selection By the driver To: malepati vishnuvardhan Cc: "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47Tm612yPwz49qW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=PTWwd2a+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::841 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (2.42), ipnet: 2607:f8b0::/32(-2.23), asn: 15169(-1.93), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.29 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 Dec 2019 08:31:55 -0000 Hi! I've documented the layout in the wiki: wiki.freebsd.org/dev/ath(4) and wiki.freebsd.org/dev/ath_hal(4) . You should start there. The HAL code is a bit twisty: * the driver - if_ath_*[ch] is common for everything; * the if_ath_pci.c code detects the NIC and creates the if_ath context and sets up the driver; * the ar9287 related bits are in sys/dev/ath/ath_hal/ar9002/ar9287_*.[ch] * I think it also uses a bit of code in the ar9280_.*[ch] and the RF frontend in that directory * the bulk of the MAC support is the same as the other 11n chips, and that's in sys/dev/ath/ath_hal/ar5416/ ; and * to save code duplication, the ar5416 HAL actually uses the code in sys/dev/ath/ath_hal/ar5212/ where the chipset support is the same. The reasons are! * The AR5416 is the first 11n chipset by atheros, and although the radio and chunks of the MAC are different (to do 11n!), the queue and airtime management parts of the MAC are the same as as the AR5212. So to save on code duplication, the original contributor called the AR5212 routines from the AR5416 HAL where the hardware was the same; * The AR9287 is an evolution of the AR9280 NIC, albeit 2G only with some specific extensions which we don't support. I hope that helps! -adrian