Hi!

Sorry for not replying earlier.

The 30 second version - you should look at uath and ath9k's usb code. It's
not ENTIRELY just a register access method - there are a bunch of things
that are done by firmware via calls - like setting the mode,
adding/removing nodes, etc. ath(4) will need a bunch of stuff turned into
methods that the USB driver calls into.

Sorry I can't be more help right now, life's busy as heck atm.


-a


On Sat, 22 Dec 2018 at 15:50, lr x <lrx...@gmail.com> wrote:

> 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.
>
_______________________________________________
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"

Reply via email to