-/* $OpenBSD: qwx.c,v 1.50 2024/02/22 09:08:08 stsp Exp $ */
+/* $OpenBSD: qwx.c,v 1.51 2024/02/22 21:21:35 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
ret = qwx_wmi_cmd_send(wmi, m, WMI_PDEV_SET_PARAM_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PDEV_SET_PARAM cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_PDEV_SET_PARAM cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_LRO_CONFIG_CMDID);
if (ret) {
- printf("%s: failed to send lro cfg req wmi cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send lro cfg req wmi cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_STA_POWERSAVE_MODE_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PDEV_SET_PARAM cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_PDEV_SET_PARAM cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_SCAN_PROB_REQ_OUI_CMDID);
if (ret) {
- printf("%s: failed to send WMI_SCAN_PROB_REQ_OUI cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_SCAN_PROB_REQ_OUI cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m,
WMI_PDEV_DFS_PHYERR_OFFLOAD_ENABLE_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PDEV_DFS_PHYERR_OFFLOAD_ENABLE "
- "cmd\n", sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send "
+ "WMI_PDEV_DFS_PHYERR_OFFLOAD_ENABLE cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_free(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_SCAN_CHAN_LIST_CMDID);
if (ret) {
- printf("%s: failed to send WMI_SCAN_CHAN_LIST cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_SCAN_CHAN_LIST "
+ "cmd\n", sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_11D_SCAN_START_CMDID);
if (ret) {
- printf("%s: failed to send WMI_11D_SCAN_START_CMDID: %d\n",
- sc->sc_dev.dv_xname, ret);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_11D_SCAN_START_CMDID: "
+ "%d\n", sc->sc_dev.dv_xname, ret);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_START_SCAN_CMDID);
if (ret) {
- printf("%s: failed to send WMI_START_SCAN_CMDID\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_START_SCAN_CMDID\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_STOP_SCAN_CMDID);
if (ret) {
- printf("%s: failed to send WMI_STOP_SCAN_CMDID\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_STOP_SCAN_CMDID\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_PEER_CREATE_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_PEER_CREATE cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit WMI_PEER_CREATE cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_PEER_DELETE_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PEER_DELETE cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_PEER_DELETE cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_PEER_ASSOC_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PEER_ASSOC_CMDID\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_PEER_ASSOC_CMDID\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_INIT_CMDID);
if (ret) {
- printf("%s: failed to send WMI_INIT_CMDID\n", __func__);
+ if (ret != ESHUTDOWN)
+ printf("%s: failed to send WMI_INIT_CMDID\n", __func__);
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(&wmi->wmi[0], m, WMI_PDEV_SET_HW_MODE_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PDEV_SET_HW_MODE_CMDID\n",
- __func__);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send "
+ "WMI_PDEV_SET_HW_MODE_CMDID\n", __func__);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_STA_POWERSAVE_PARAM_CMDID);
if (ret) {
- printf("%s: failed to send WMI_STA_POWERSAVE_PARAM_CMDID",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send "
+ "WMI_STA_POWERSAVE_PARAM_CMDID",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
#endif
ret = qwx_wmi_cmd_send(wmi, m, WMI_MGMT_TX_SEND_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_MGMT_TX_SEND_CMDID cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit "
+ "WMI_MGMT_TX_SEND_CMDID cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_CREATE_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_VDEV_CREATE_CMDID\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit WMI_VDEV_CREATE_CMDID\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_SET_PARAM_CMDID);
if (ret) {
- printf("%s: failed to send WMI_VDEV_SET_PARAM_CMDID\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_VDEV_SET_PARAM_CMDID\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
#endif
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_UP_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_VDEV_UP cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit WMI_VDEV_UP cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_DOWN_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_VDEV_DOWN cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit WMI_VDEV_DOWN cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_STOP_CMDID);
if (ret) {
- printf("%s: failed to submit WMI_VDEV_STOP cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit WMI_VDEV_STOP cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, restart ?
WMI_VDEV_RESTART_REQUEST_CMDID : WMI_VDEV_START_REQUEST_CMDID);
if (ret) {
- printf("%s: failed to submit vdev_%s cmd\n",
- sc->sc_dev.dv_xname, restart ? "restart" : "start");
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to submit vdev_%s cmd\n",
+ sc->sc_dev.dv_xname, restart ? "restart" : "start");
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_send_11d_scan_start_cmd(sc, ¶m,
0 /* TODO: derive pdev ID from arvif somehow? */);
if (ret) {
- printf("%s: failed to start 11d scan; vdev: %d ret: %d\n",
- sc->sc_dev.dv_xname, arvif->vdev_id, ret);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to start 11d scan; vdev: %d "
+ "ret: %d\n", sc->sc_dev.dv_xname,
+ arvif->vdev_id, ret);
+ }
} else {
sc->vdev_id_11d_scan = arvif->vdev_id;
if (sc->state_11d == ATH11K_11D_PREPARING)
ret = qwx_wmi_cmd_send(wmi, m, WMI_PEER_SET_PARAM_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PEER_SET_PARAM cmd\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send WMI_PEER_SET_PARAM cmd\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
return ret;
}
ret = qwx_wmi_cmd_send(wmi, m, WMI_PEER_REORDER_QUEUE_SETUP_CMDID);
if (ret) {
- printf("%s: failed to send WMI_PEER_REORDER_QUEUE_SETUP\n",
- sc->sc_dev.dv_xname);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to send "
+ "WMI_PEER_REORDER_QUEUE_SETUP\n",
+ sc->sc_dev.dv_xname);
+ }
m_freem(m);
}
ret = qwx_start_scan(sc, arg);
if (ret) {
- printf("%s: failed to start hw scan: %d\n",
- sc->sc_dev.dv_xname, ret);
+ if (ret != ESHUTDOWN) {
+ printf("%s: failed to start hw scan: %d\n",
+ sc->sc_dev.dv_xname, ret);
+ }
#ifdef notyet
spin_lock_bh(&ar->data_lock);
#endif