# Qualcomm Atheros AR9565/QCA9595



## stroudmw (Jan 11, 2021)

I have an HP ProBook 450 G1 laptop, running FreeBSD 12-2. I can't get the wireless card working: the Wireless light on the laptop's keyboard does not come on (ie: it stays orange, instead of turning white).

I have followed the instructions here: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html but that hasn't helped.

I have put:

```
wlans_ath0="wlan0"
ifconfig_wlan0="inet 192.168.8.250 netmask 255.255.255.0 ssid (my password)"
```
into /etc/rc.conf, and

```
if_ath_load="YES"
wlan_wep_load="YES"
```
into /boot/loader.conf

`sysctl net.wlan.devices` gives me this: `net.wlan.devices: ath0`

and ifconfig gives me this:

```
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 20:68:9d:e0:fc:6d
    inet 192.168.8.250 netmask 0xffffff00 broadcast 192.168.8.255
    groups: wlan
    ssid (my password) channel 6 (2437 MHz 11g)
    regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7
    scanvalid 60 protmode CTS wme burst bintval 0
    parent interface: ath0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```
`grep wpa /var/log/messages`:

```
Jan 10 12:22:11 constellation pkg[1871]: wpa_supplicant-2.9_7 installed
Jan 11 13:18:11 constellation wpa_supplicant[2075]: Successfully initialized wpa_supplicant
Jan 11 13:18:11 constellation wpa_supplicant[2075]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
Jan 11 13:26:46 constellation wpa_supplicant[334]: wlan0: CTRL-EVENT-TERMINATING
```
...which tells me that I've got an Invalid Argument somewhere.

Here is my /etc/wpa_supplicant.conf file:

```
network={
    ssid="HUAWEI-B315-E7FC"
    psk="(my password)"
}
```
NB: I have replaced my psk with (my password) in this post.

So, I'm stuck. Any advice would be appreciated. Thanks.


----------



## free-and-bsd (Jan 11, 2021)

What does your `dmesg | grep ath` output say? Does it show ath driver finding your wireless card? That'll be your starting point. Cause if it doesn't...
I couldn't find a definite confirmation that this chip IS supported.


----------



## SirDice (Jan 11, 2021)

stroudmw said:


> ```
> if_ath_load="YES"
> wlan_wep_load="YES"
> ```
> into /boot/loader.conf


Not related to your issue but you can remove these, they're already part of the GENERIC kernel and don't need to be loaded.


----------



## Phishfry (Jan 11, 2021)

free-and-bsd said:


> I couldn't find a definite confirmation that this chip IS supported.


I know the AR9580 is supported as I use it:


```
ath0@pci0:4:0:0:    class=0x028000 card=0xd01419b6 chip=0x0033168c rev=0x01 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'AR958x 802.11abgn Wireless Network Adapter'
    class      = network
```

I use it for my wireless access point.

```
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 4c:5e:0c:11:65:38
    groups: wlan
    ssid apu2ap channel 36 (5180 MHz 11a ht/40+) bssid 4c:5e:0c:11:65:38
    regdomain FCC country US ecm authmode WPA2/802.11i privacy MIXED
    deftxkey 2 TKIP 2:128-bit TKIP 3:128-bit txpower 17 mcastrate 6
    mgmtrate 6 scanvalid 60 ampdulimit 64k ampdudensity 8 shortgi wme
    burst dtimperiod 1 -dfs
    media: IEEE 802.11 Wireless Ethernet autoselect mode 11na <hostap>
    status: running
```


----------



## stroudmw (Jan 12, 2021)

free-and-bsd said:


> What does your `dmesg | grep ath` output say? Does it show ath driver finding your wireless card? That'll be your starting point. Cause if it doesn't...
> I couldn't find a definite confirmation that this chip IS supported.


`dmesg | grep ath` shows this:

```
[ath_hal] loaded
[ath_dfs] loaded
[ath_rate] loaded
[ath] loaded
ath0: <Qualcomm Atheros AR9565> mem 0xb0600000-0xb067ffff at device 0.0 on pci4
ath0: WB335 1-ANT card detected
ath0: Bluetooth Antenna Diversity card detected
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: QCA9565 mac 704.0 RF5110 phy 3422.6
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000
ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
```


----------



## stroudmw (Jan 12, 2021)

Ok. I give up! I've now spent 2 days trying to get this to work.

To compound the wifi problem, the ethernet card in that machine is a Qualcomm/Atheros QCA9565/AR9565, which really doesn't work well either: it starts off well enough, but then gets slower and slower until it stops completely.  

So, not only don't I have wifi, my wired connection is totally unreliable. As I said: I give up. A server without a reliable network connection is rather useless.


----------



## SirDice (Jan 12, 2021)

stroudmw said:


> Qualcomm/Atheros QCA9565/AR9565


That's a wireless chipset, not ethernet. The QCA9565 is a dual chip that has Wifi and Bluetooth. 









						QCA9565 | CMOS combo-chip for 2.4 GHz 802.11n & Bluetooth | Qualcomm
					

The Qualcomm Atheros QCA9565 WLAN function integrates a multi-protocol MAC, baseband processor, analog-todigital/digital-to-analog converters (ADC/DAC), 1x1 radio transceivers, and PCI Express interface.




					www.qualcomm.com
				




According to the specifications the ethernet should be a Realtek RTL8151FH-CG. 





						HP ProBook 450 G1 Notebook PC Product Specifications | HP® Customer Support
					

Specifications page for HP ProBook 450 G1 Notebook PC.




					support.hp.com
				




The closest I could find was if_rue(4) (RTL8150) and if_ure(4) (RTL8152/8153). The RTL8151 seems to be unsupported.


----------



## sidetone (Jan 12, 2021)

When it comes to wireless, I found that inputting more information into wpa_supplicant.conf improves the speed in which it connects. It also seems more reliable.

bssid of your gateway, from what you get from `ifconfig`,


```
eapol_version=1
network={
    ssid="HUAWEI-B315-E7FC"
    psk="(my password)"
    bssid="gateway's MAC address"
    proto=RSN
    key_mgmt=WPA_PSK
    pairwise=
    group=
}
```

wpa_supplicant.conf(5)

eapol_version can be set to 1 or 2. Trial and error can help determine which one works.
ap_scan default should be left alone, as other settings are for other operating systems.

In proto, RSN means WPA2. For key management, yours uses WPA_PSK. group and pairwise are optional and would likely have the same argument.

Setting a static channel on the gateway/router (that has less interference from nearby wireless networks), then limiting to that channel in your wpa configuration file, may help. For me, it seemed to make my wireless connection more sturdy.

There's some redundancy in wpa_supplicant.conf and what can go in rc.conf for network entries. It's better to fill those when when you're sure they'll work.

The bssid can be inserted into rc.conf as well:

```
ifconfig_wlan0="inet 192.168.8.250 netmask 255.255.255.0 ssid (my password) bssid (macaddressofnetwork)"
```



SirDice said:


> The closest I could find was if_rue(4) (RTL8150) and if_ure(4) (RTL8152/8153). The RTL8151 seems to be unsupported.


Pertaining to video cards, the last digit is included by what what's rounded to the 10's place. Maybe that's not the case here, as what you wrote implied. If the exact number isn't available, it's worth trying anyway.


----------



## SirDice (Jan 12, 2021)

SirDice said:


> The closest I could find was if_rue(4) (RTL8150) and if_ure(4) (RTL8152/8153). The RTL8151 seems to be unsupported.





sidetone said:


> Pertaining to video cards, the last digit is included by what what's rounded to the 10's place. Maybe that's not the case here, as what you wrote implied. If the exact number isn't available, it's worth trying anyway.


I sort of expected them to be included in the GENERIC kernel but I just checked the config for 12.2 and they're not there. So it's definitely worth a shot loading these.


----------



## stroudmw (Jan 13, 2021)

Thanks to all of you who took the time to reply. What I ended up doing was to do a re-install, this time selecting the Qualcomm card. I ignored the option to change country, scanned (and found) my network, and entered the password. It seems to be working.

Here are the salient details:


```
mike@constellation:~ $ sudo kldstat
Id Refs Address                Size Name
 1   27 0xffffffff80200000  227ad00 kernel
 2    1 0xffffffff8247c000   3bad38 zfs.ko
 3    2 0xffffffff82837000     a448 opensolaris.ko
 4    1 0xffffffff82e11000     4260 ng_ubt.ko
 5    6 0xffffffff82e16000     9bd0 netgraph.ko
 6    2 0xffffffff82e20000     9128 ng_hci.ko
 7    3 0xffffffff82e2a000      9b0 ng_bluetooth.ko
 8    1 0xffffffff82e2b000     caf0 ng_l2cap.ko
 9    1 0xffffffff82e38000    1af20 ng_btsocket.ko
10    1 0xffffffff82e53000     2150 ng_socket.ko
mike@constellation:~ $
```


```
mike@constellation:~ $ cat /etc/rc.conf
clear_tmp_enable="YES"
sendmail_enable="NONE"
hostname="constellation"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
```


```
root@constellation:/usr/home/mike # cat /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
    ssid="HUAWEI-B315-E7FC"
    scan_ssid=0
    psk="(my password)"
    priority=5
}
network={
    priority=0
    key_mgmt=NONE
}
```

There are a couple of things:
- the wifi led on the keyboard doesn't change to "white", but remains orange. This means it's off (which it isn't)
- I haven't gotten around to selecting a static IP yet. I thought I'd quit while I was ahead and post configuration settings that work. I might need to look at them again one day 

Of course, now I need to get my wired connection to work again!


----------



## stroudmw (Jan 14, 2021)

Several hours later...
I have the static IP setup This from my rc.conf:


```
ifconfig_wlan0="WPA inet 192.168.8.250 netmask 255.255.255.0 ssid 'HUAWEI-B315-E7FC'"
defaultrouter="192.168.8.1"
```

It has been very stable, but rather slow at around 5 MiB/s. So, loading data is taking a long time, but once loaded, it will not change much.

It looks like I have found a replacement for my Centos Seafile server. Thanks again to all of you for your help!


----------



## free-and-bsd (Jan 14, 2021)

SirDice said:


> ...
> 
> According to the specifications the ethernet should be a Realtek RTL8151FH-CG.
> 
> ...


My goodness, that'd be a disaster. I mean, a USB ethernet adaptor will not give a gigabyte connection.
So! It seams to be a really good advice to look up LAN chip specs when buying a laptop, right? Since recently (I think it was one of your posts) I prefer Intel LAN.
Off-topic: and BTW, for some reason or other, I have a _stable_ negative experience with HP hardware like printers & laptops. The printers are more expensive and use more Windows-oriented drivers. The laptops are always _worse _then other brands in the same price category... or is it just me? 
The only "positive" explanation I can give it is that HP is more interested in high-price things like servers etc. Though I've never used these.


----------



## stroudmw (Jan 27, 2021)

More than a week later...
The network is too unstable to use. The connection drops starts well enough (but 5Mbs isn't really that great as I was getting around 50Mbs with Centos) but after about an hour it drops to almost nothing. I use it for streaming, and it just slowly dies on me. This requires a reboot every hour or so.
Back to the drawing board...


----------

