Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/pci More sc->vap converstions based on if_iwn.c.



details:   https://anonhg.NetBSD.org/src-all/rev/d52db32b6e84
branches:  trunk
changeset: 940425:d52db32b6e84
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sat Aug 29 03:46:31 2020 +1000

description:
More sc->vap converstions based on if_iwn.c.
Fix variable botches.

diffstat:

 sys/dev/pci/if_iwm.c |  58 +++++++++++++++++++++++++--------------------------
 1 files changed, 28 insertions(+), 30 deletions(-)

diffs (184 lines):

diff -r 73633f42a2a3 -r d52db32b6e84 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Sat Aug 29 03:16:20 2020 +1000
+++ b/sys/dev/pci/if_iwm.c      Sat Aug 29 03:46:31 2020 +1000
@@ -375,13 +375,13 @@
 static int     iwm_calc_rssi(struct iwm_softc *, struct iwm_rx_phy_info *);
 static int     iwm_get_signal_strength(struct iwm_softc *,
                    struct iwm_rx_phy_info *);
-static void    iwm_rx_rx_phy_cmd(struct iwm_softc *,
+static void    iwm_rx_rx_phy_cmd(struct ieee80211vap *,
                    struct iwm_rx_packet *, struct iwm_rx_data *);
 static int     iwm_get_noise(const struct iwm_statistics_rx_non_phy *);
-static void    iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
+static void    iwm_rx_rx_mpdu(struct ieee80211vap *, struct iwm_rx_packet *,
                    struct iwm_rx_data *);
-static void    iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,                    struct iwm_node *);
-static void    iwm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *,
+static void    iwm_rx_tx_cmd_single(struct ieee80211vap *, struct iwm_rx_packet *,                 struct iwm_node *);
+static void    iwm_rx_tx_cmd(struct ieee80211vap *, struct iwm_rx_packet *,
                    struct iwm_rx_data *);
 static int     iwm_binding_cmd(struct iwm_softc *, struct iwm_node *,
                    uint32_t);
@@ -479,7 +479,7 @@
 static int     iwm_send_bt_init_conf(struct iwm_softc *);
 static int     iwm_send_update_mcc_cmd(struct iwm_softc *, const char *);
 static void    iwm_tt_tx_backoff(struct iwm_softc *, uint32_t);
-static int     iwm_init_hw(struct ieee80211_vap *);
+static int     iwm_init_hw(struct ieee80211vap *);
 static int     iwm_init(struct ifnet *);
 static void    iwm_start(struct ifnet *);
 static void    iwm_stop(struct ifnet *, int);
@@ -490,7 +490,7 @@
 static void    iwm_nic_error(struct iwm_softc *);
 static void    iwm_nic_umac_error(struct iwm_softc *);
 #endif
-static void    iwm_notif_intr(struct iwm_softc *);
+static void    iwm_notif_intr(struct ieee80211vap *);
 static int     iwm_intr(void *);
 static void    iwm_softintr(void *);
 //static int   iwm_preinit(struct iwm_softc *);
@@ -3951,9 +3951,10 @@
 }
 
 static void
-iwm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
+iwm_rx_rx_phy_cmd(struct ieee80211vap *vap, struct iwm_rx_packet *pkt,
     struct iwm_rx_data *data)
 {
+       struct iwm_softc *sc = vap->iv_ic->ic_softc;
        struct iwm_rx_phy_info *phy_info = (void *)pkt->data;
 
        DPRINTFN(20, ("received PHY stats\n"));
@@ -3985,11 +3986,11 @@
 }
 
 static void
-iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
+iwm_rx_rx_mpdu(struct ieee80211vap *vap, struct iwm_rx_packet *pkt,
     struct iwm_rx_data *data)
 {
-       struct ieee80211com *ic = &sc->sc_ic;
-       struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+       struct ieee80211com *ic = vap->iv_ic;
+       struct iwm_softc *sc = ic->ic_softc;
        struct ieee80211_frame *wh;
        struct ieee80211_node *ni;
        struct ieee80211_channel *c = NULL;
@@ -4119,11 +4120,9 @@
 }
 
 static void
-iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
+iwm_rx_tx_cmd_single(struct ieee80211vap *vap, struct iwm_rx_packet *pkt,
     struct iwm_node *in)
 {
-       struct ieee80211com *ic = &sc->sc_ic;
-       struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
        struct ifnet *ifp = vap->iv_ifp;
        struct iwm_tx_resp *tx_resp = (void *)pkt->data;
        int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK;
@@ -4145,11 +4144,9 @@
 }
 
 static void
-iwm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
+iwm_rx_tx_cmd(struct ieee80211vap *vap, struct iwm_rx_packet *pkt,
     struct iwm_rx_data *data)
 {
-       struct ieee80211com *ic = &sc->sc_ic;
-       struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
        struct ifnet *ifp = vap->iv_ifp;
        struct iwm_cmd_header *cmd_hdr = &pkt->hdr;
        int idx = cmd_hdr->idx;
@@ -4173,7 +4170,7 @@
 
        sc->sc_tx_timer = 0;
 
-       iwm_rx_tx_cmd_single(sc, pkt, in);
+       iwm_rx_tx_cmd_single(vap, pkt, in);
 
        bus_dmamap_sync(sc->sc_dmat, txd->map, 0, txd->map->dm_mapsize,
            BUS_DMASYNC_POSTWRITE);
@@ -6150,7 +6147,7 @@
 {
        struct ieee80211_node *ni = &in->in_ni;
        struct ieee80211com *ic = ni->ni_ic;
-       struct iwm_softc *sc = ic->if_softc;
+       struct iwm_softc *sc = ic->ic_softc;
        struct iwm_lq_cmd *lq = &in->in_lq;
        struct ieee80211_rateset *rs = &ni->ni_rates;
        int i, j, ridx, ridx_min, tab = 0;
@@ -6283,11 +6280,11 @@
 }
 
 static int
-iwm_do_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
-{
-       struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+iwm_do_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
+{
        struct ifnet *ifp = vap->iv_ifp;
-       struct iwm_softc *sc = ic->if_softc;
+       struct ieee80211com *ic = vap->iv_ic;
+       struct iwm_softc *sc = ic->ic_softc;
        enum ieee80211_state ostate = ic->ic_state;
        struct iwm_node *in;
        int err;
@@ -6458,7 +6455,7 @@
 iwm_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
 {
        struct iwm_newstate_state *iwmns;
-       struct iwm_softc *sc = ic->if_softc;
+       struct iwm_softc *sc = ic->ic_softc;
 
        callout_stop(&sc->sc_calib_to);
 
@@ -6711,7 +6708,7 @@
 iwm_init_hw(struct ieee80211vap *vap)
 {
        struct ieee80211com *ic = &vap->iv_ic;
-       struct iwm_softc *sc = &ic->if_softc;
+       struct iwm_softc *sc = &ic->ic_softc;
        int err, i, ac;
 
 #if 0
@@ -7379,8 +7376,9 @@
 #define ADVANCE_RXQ(sc) (sc->rxq.cur = (sc->rxq.cur + 1) % IWM_RX_RING_COUNT);
 
 static void
-iwm_notif_intr(struct iwm_softc *sc)
-{
+iwm_notif_intr(struct ieee80211vap *vap)
+{
+       struct iwm_softc = vap->if_softc->if_softc;
        uint16_t hw;
 
        bus_dmamap_sync(sc->sc_dmat, sc->rxq.stat_dma.map,
@@ -7415,15 +7413,15 @@
 
                switch (code) {
                case IWM_REPLY_RX_PHY_CMD:
-                       iwm_rx_rx_phy_cmd(sc, pkt, data);
+                       iwm_rx_rx_phy_cmd(vap, pkt, data);
                        break;
 
                case IWM_REPLY_RX_MPDU_CMD:
-                       iwm_rx_rx_mpdu(sc, pkt, data);
+                       iwm_rx_rx_mpdu(vap, pkt, data);
                        break;
 
                case IWM_TX_CMD:
-                       iwm_rx_tx_cmd(sc, pkt, data);
+                       iwm_rx_tx_cmd(vap, pkt, data);
                        break;
 
                case IWM_MISSED_BEACONS_NOTIFICATION:
@@ -7806,7 +7804,7 @@
            isperiodic) {
                IWM_WRITE(sc, IWM_CSR_FH_INT_STATUS, IWM_CSR_FH_INT_RX_MASK);
 
-               iwm_notif_intr(sc);
+               iwm_notif_intr(vap);
 
                /* enable periodic interrupt, see above */
                if (r1 & (IWM_CSR_INT_BIT_FH_RX | IWM_CSR_INT_BIT_SW_RX) &&



Home | Main Index | Thread Index | Old Index