svn commit: r330225 - stable/11/sys/dev/iwm
Eitan Adler
eadler at FreeBSD.org
Thu Mar 1 06:56:35 UTC 2018
Author: eadler
Date: Thu Mar 1 06:56:34 2018
New Revision: 330225
URL: https://svnweb.freebsd.org/changeset/base/330225
Log:
MFC r321510:
[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.
Modified:
stable/11/sys/dev/iwm/if_iwm.c
stable/11/sys/dev/iwm/if_iwm_util.c
stable/11/sys/dev/iwm/if_iwm_util.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/iwm/if_iwm.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:10 2018 (r330224)
+++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:34 2018 (r330225)
@@ -4476,13 +4476,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_
break;
case IEEE80211_S_RUN:
- {
- struct iwm_host_cmd cmd = {
- .id = IWM_LQ_CMD,
- .len = { sizeof(in->in_lq), },
- .flags = IWM_CMD_SYNC,
- };
-
/* Update the association state, now we have it all */
/* (eg associd comes in at this point */
error = iwm_assoc(vap, sc);
@@ -4500,15 +4493,13 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_
iwm_mvm_update_quotas(sc, ivp);
iwm_setrates(sc, in);
- cmd.data[0] = &in->in_lq;
- if ((error = iwm_send_cmd(sc, &cmd)) != 0) {
+ if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) {
device_printf(sc->sc_dev,
- "%s: IWM_LQ_CMD failed\n", __func__);
+ "%s: IWM_LQ_CMD failed: %d\n", __func__, error);
}
iwm_mvm_led_enable(sc);
break;
- }
default:
break;
Modified: stable/11/sys/dev/iwm/if_iwm_util.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:10 2018 (r330224)
+++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:34 2018 (r330225)
@@ -488,6 +488,32 @@ iwm_dma_contig_free(struct iwm_dma_info *dma)
}
}
+/**
+ * iwm_mvm_send_lq_cmd() - Send link quality command
+ * @init: This command is sent as part of station initialization right
+ * after station has been added.
+ *
+ * The link quality command is sent as the last step of station creation.
+ * This is the special case in which init is set and we call a callback in
+ * this case to clear the state indicating that station creation is in
+ * progress.
+ */
+int
+iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, boolean_t init)
+{
+ struct iwm_host_cmd cmd = {
+ .id = IWM_LQ_CMD,
+ .len = { sizeof(struct iwm_lq_cmd), },
+ .flags = init ? 0 : IWM_CMD_ASYNC,
+ .data = { lq, },
+ };
+
+ if (lq->sta_id == IWM_MVM_STATION_COUNT)
+ return EINVAL;
+
+ return iwm_send_cmd(sc, &cmd);
+}
+
boolean_t
iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc)
{
Modified: stable/11/sys/dev/iwm/if_iwm_util.h
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:10 2018 (r330224)
+++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:34 2018 (r330225)
@@ -120,6 +120,9 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str
bus_size_t size, bus_size_t alignment);
extern void iwm_dma_contig_free(struct iwm_dma_info *);
+extern int iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq,
+ boolean_t init);
+
extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc);
extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx);
More information about the svn-src-stable-11
mailing list