freebsd11 / iprowifi4965: GCC2 fixes.

This commit is contained in:
Augustin Cavalier
2018-06-27 20:26:53 -04:00
parent 8b4aff3eac
commit 97f9cb046c
4 changed files with 15 additions and 9 deletions
@@ -5081,7 +5081,7 @@ iwn_parent(struct ieee80211com *ic)
struct iwn_softc *sc = ic->ic_softc; struct iwn_softc *sc = ic->ic_softc;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
int startall = 0, stop = 0; int startall = 0, stop = 0;
IWN_LOCK(sc); IWN_LOCK(sc);
if (ic->ic_nrunning > 0) { if (ic->ic_nrunning > 0) {
if (!(sc->sc_flags & IWN_FLAG_RUNNING)) { if (!(sc->sc_flags & IWN_FLAG_RUNNING)) {
@@ -7480,10 +7480,10 @@ static void
iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni,
int qid, uint8_t tid, uint16_t ssn) int qid, uint8_t tid, uint16_t ssn)
{ {
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
struct iwn_node *wn = (void *)ni; struct iwn_node *wn = (void *)ni;
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
/* Stop TX scheduler while we're changing its configuration. */ /* Stop TX scheduler while we're changing its configuration. */
iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),
IWN5000_TXQ_STATUS_CHGACT); IWN5000_TXQ_STATUS_CHGACT);
@@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
//static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); //static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers");
#define SBMALLOC(size) malloc(size) #define SBMALLOC(size) malloc(size)
#define SBFREE(buf) free(buf) #define SBFREE(buf) free(buf)
#if __GNUC__ == 2
# define va_copy(to, from) __va_copy(to, from)
#endif
#else /* _KERNEL */ #else /* _KERNEL */
#define KASSERT(e, m) #define KASSERT(e, m)
#define SBMALLOC(size) calloc(1, size) #define SBMALLOC(size) calloc(1, size)
@@ -95,9 +95,10 @@ ieee80211_ack_rate(const struct ieee80211_rate_table *rt, uint8_t rate)
* If the caller wishes to use it for a basic rate, they should * If the caller wishes to use it for a basic rate, they should
* clear the high bit first. * clear the high bit first.
*/ */
uint8_t cix;
KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate));
uint8_t cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex; cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex;
KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate)); KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate));
return rt->info[cix].dot11Rate; return rt->info[cix].dot11Rate;
} }
@@ -110,9 +111,10 @@ ieee80211_ctl_rate(const struct ieee80211_rate_table *rt, uint8_t rate)
* If the caller wishes to use it for a basic rate, they should * If the caller wishes to use it for a basic rate, they should
* clear the high bit first. * clear the high bit first.
*/ */
uint8_t cix;
KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate));
uint8_t cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex; cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex;
KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate)); KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate));
return rt->info[cix].dot11Rate; return rt->info[cix].dot11Rate;
} }
@@ -125,9 +127,10 @@ ieee80211_rate2phytype(const struct ieee80211_rate_table *rt, uint8_t rate)
* If the caller wishes to use it for a basic rate, they should * If the caller wishes to use it for a basic rate, they should
* clear the high bit first. * clear the high bit first.
*/ */
uint8_t rix;
KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate));
uint8_t rix = rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]; rix = rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL];
KASSERT(rix != (uint8_t)-1, ("rate %d has no info", rate)); KASSERT(rix != (uint8_t)-1, ("rate %d has no info", rate));
return (enum ieee80211_phytype)rt->info[rix].phy; return (enum ieee80211_phytype)rt->info[rix].phy;
} }
@@ -108,7 +108,7 @@ typedef void (*ieee80211vap_attach)(struct ieee80211vap *);
struct ieee80211_appie { struct ieee80211_appie {
uint16_t ie_len; /* size of ie_data */ uint16_t ie_len; /* size of ie_data */
uint8_t ie_data[]; /* user-specified IE's */ uint8_t ie_data[0]; /* user-specified IE's */
}; };
struct ieee80211_tdma_param; struct ieee80211_tdma_param;
@@ -465,7 +465,7 @@ struct ieee80211vap {
int (*iv_key_alloc)(struct ieee80211vap *, int (*iv_key_alloc)(struct ieee80211vap *,
struct ieee80211_key *, struct ieee80211_key *,
ieee80211_keyix *, ieee80211_keyix *); ieee80211_keyix *, ieee80211_keyix *);
int (*iv_key_delete)(struct ieee80211vap *, int (*iv_key_delete)(struct ieee80211vap *,
const struct ieee80211_key *); const struct ieee80211_key *);
int (*iv_key_set)(struct ieee80211vap *, int (*iv_key_set)(struct ieee80211vap *,
const struct ieee80211_key *); const struct ieee80211_key *);
@@ -798,7 +798,7 @@ ieee80211_draintask(struct ieee80211com *ic, struct task *task)
taskqueue_drain(ic->ic_tq, task); taskqueue_drain(ic->ic_tq, task);
} }
/* /*
* Key update synchronization methods. XXX should not be visible. * Key update synchronization methods. XXX should not be visible.
*/ */
static __inline void static __inline void