From owner-freebsd-wireless@freebsd.org Sat Dec 22 23:50:02 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 7DC3A133F96F for ; Sat, 22 Dec 2018 23:50:02 +0000 (UTC) (envelope-from lrx337@gmail.com) Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAF077258; Sat, 22 Dec 2018 23:50:01 +0000 (UTC) (envelope-from lrx337@gmail.com) Received: by mail-io1-xd44.google.com with SMTP id o13so5277182ioh.2; Sat, 22 Dec 2018 15:50:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=8nKoCop+B1FVlV39RyjJKAA+I9ZGSKG1q+LR1vGXfwE=; b=pH973gnI92sFLYAFb9bSOjd0MAgxwWtrkd02QCvQ7AE+HNLhP0yZHLCHmIvHfJ7THD yDQkNKEQmw77eCLA0VbAEUeTQxh9eXfruohSXUvW4msCNm+aqA51dFmMepWOyIUw+3HW jRcRNMJLJVCvVtuAXRhFsZdRoJ/zaNw/b4JK50YD9MSytcU3IHYhnrAwY9veBIjKtGSh 9AE6BHa5rupZGIRcMzzvUpACUfiJPAc5n0pRncSb4Q7tV2nIC0o/yDBUPUxRTFkQZ5pF nwDqLUHyrHDHX3xu/ju1P0NKuXTofWOIHoaLNlTfGco92ReSx+0wvmhays/lR0aWxKL8 /Uhw== 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:cc; bh=8nKoCop+B1FVlV39RyjJKAA+I9ZGSKG1q+LR1vGXfwE=; b=oDNvWVdNshAF3iXz/70GyBCOYHVZMvs0XQ46PUA6eDQOhQ13/Hl08D0f1XinlIInI6 l/E13AJHfNRZpYBTy6pUro0fa+oVSLbsDaJrM2NKRMs1qghtwSlCXgeoTrRy5Ozl+czl CGktExbrWh2B2PwCKxcZBKSAbyx0mE8ttfCuOlCCcpYc/wWKdaKbNZ1aXlVu2ClWzB0j AGldPSj6FF2G2bTQCsmj/GUkKtqKUwQt4mWCEbXP/L6YUsFqbEjNppAoW8GphePgmtuv 9aBCAjxXKlmnXey7ISxPGvR3HRBMik6QyLFP5vehxbC6grir92MFKi92L16Mm/eccYJA xJWw== X-Gm-Message-State: AJcUukeYQyZpXSHYb9GagoHDqObW+Y0SDI0i/T6k4T8MJ32M4Olt1faL R82Q9LfOCtsJZgKOQLXwkN67sYGtbGZqTAbuZHJeE9Aw X-Google-Smtp-Source: ALg8bN53D3v9Sm/OLvkudpjveTNMEbmzIX8k13IQoqejBT9UUBMdwI7NSzq6WoDgk64WsAqbYvDcM+ErnZH07nEVWu8= X-Received: by 2002:a5e:840f:: with SMTP id h15mr5151212ioj.42.1545522599815; Sat, 22 Dec 2018 15:49:59 -0800 (PST) MIME-Version: 1.0 From: lr x Date: Sat, 22 Dec 2018 18:49:48 -0500 Message-ID: Subject: Support for AR9271 (ath USB glue) To: freebsd-wireless@freebsd.org Cc: adrian@freebsd.org, kevans@freebsd.org X-Rspamd-Queue-Id: 2FAF077258 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pH973gnI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of lrx337@gmail.com designates 2607:f8b0:4864:20::d44 as permitted sender) smtp.mailfrom=lrx337@gmail.com X-Spamd-Result: default: False [-2.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.982,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.990,0]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_SHORT(0.91)[0.915,0]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.d.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]; IP_SCORE(-0.08)[ip: (2.96), ipnet: 2607:f8b0::/32(-1.83), asn: 15169(-1.46), country: US(-0.08)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sat, 22 Dec 2018 23:50:02 -0000 Hi, I have a TP-LINK device[1] and I'd like to get this running on FreeBSD. I have searched the interwebs[2][3] and, as I understand, the only thing that's blocking this is the missing usb glue in ath / ath_hal [4][5]. I'm not entirely sure of how it all works together. What all should the USB glue be doing? uath seems to be handling stuff like radiotap headers that I'm not really sure belong in this USB glue. otus[6] seems a more likely candidate of what this glue code should look like. Or is this about adding USB support to the existing ath hal code (like checking if USB device is supported when ath_hal_probe() is called?) I started writing an if_ath_usb.c file under sys/dev/ath and have probe() working for my device. I'm looking at the ukbd, uath, otus and if_ath_pci modules to understand what if_ath_usb should do (along with man usbdi). Have I completely misunderstood what needs to be done? >From the if_ath_usb.c I have right now: static int ath_usb_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); printf("[ath_usb_probe] vendorId = %x, productId %x\n", uaa->info.idVendor, uaa->info.idProduct); /* Skipping ath_hal_probe here as we have not registered a chip (YET).. */ /* Check if product is AR9271 chip */ /* idVendor = 0x0cf3 */ /* idProduct = 0x9271 */ if(uaa->info.idVendor == 0x0cf3 && uaa->info.idProduct == 0x9271) return BUS_PROBE_DEFAULT; return ENXIO; } [1] https://wikidevi.com/wiki/TP-LINK_TL-WN721N [2] https://lists.freebsd.org/pipermail/freebsd-wireless/2015-June/005934.html [3] https://wiki.freebsd.org/dev/ath_hal%284%29/HardwareSupport (Chipsets I won't be working on) [4] https://wiki.freebsd.org/dev/ath_hal%284%29 [5] https://wiki.freebsd.org/dev/ath_hal%284%29/ApiOverview [6] http://adrianchadd.blogspot.com/2015/09/porting-wifi-driver-from-openbsd-ar9170.html Regards.