Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2018 18:49:48 -0500
From:      lr x <lrx337@gmail.com>
To:        freebsd-wireless@freebsd.org
Cc:        adrian@freebsd.org, kevans@freebsd.org
Subject:   Support for AR9271 (ath USB glue)
Message-ID:  <CAFgaRUXe-=9hjFeswe14_TpefxuxvjG2XNEMLLgpnpeEmvXfGQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFgaRUXe-=9hjFeswe14_TpefxuxvjG2XNEMLLgpnpeEmvXfGQ>