Date: Sat, 25 Mar 2017 15:57:48 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315958 - head/sys/dev/iwn Message-ID: <201703251557.v2PFvmhP060893@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Sat Mar 25 15:57:47 2017 New Revision: 315958 URL: https://svnweb.freebsd.org/changeset/base/315958 Log: iwn: do not try to update node configuration when the node does not exist. Firmware will just respond with status '0x8' (node does not exist) or will hang -> cause 'device timeout's (sometimes). Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Mar 25 15:47:29 2017 (r315957) +++ head/sys/dev/iwn/if_iwn.c Sat Mar 25 15:57:47 2017 (r315958) @@ -2651,7 +2651,15 @@ iwn_read_eeprom_enhinfo(struct iwn_softc static struct ieee80211_node * iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); + struct iwn_node *wn; + + wn = malloc(sizeof (struct iwn_node), M_80211_NODE, M_NOWAIT | M_ZERO); + if (wn == NULL) + return (NULL); + + wn->id = IWN_ID_UNDEFINED; + + return (&wn->ni); } static __inline int @@ -7355,6 +7363,9 @@ iwn_ampdu_rx_start(struct ieee80211_node tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID); ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START); + if (wn->id == IWN_ID_UNDEFINED) + return (ENOENT); + memset(&node, 0, sizeof node); node.id = wn->id; node.control = IWN_NODE_UPDATE; @@ -7386,6 +7397,9 @@ iwn_ampdu_rx_stop(struct ieee80211_node DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (wn->id == IWN_ID_UNDEFINED) + goto end; + /* XXX: tid as an argument */ for (tid = 0; tid < WME_NUM_TID; tid++) { if (&ni->ni_rx_ampdu[tid] == rap) @@ -7399,6 +7413,7 @@ iwn_ampdu_rx_stop(struct ieee80211_node node.delba_tid = tid; DPRINTF(sc, IWN_DEBUG_RECV, "DELBA RA=%d TID=%d\n", wn->id, tid); (void)ops->add_node(sc, &node, 1); +end: sc->sc_ampdu_rx_stop(ni, rap); } @@ -7473,6 +7488,9 @@ iwn_ampdu_tx_start(struct ieee80211com * DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (wn->id == IWN_ID_UNDEFINED) + return (0); + /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); memset(&node, 0, sizeof node); Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sat Mar 25 15:47:29 2017 (r315957) +++ head/sys/dev/iwn/if_iwnreg.h Sat Mar 25 15:57:47 2017 (r315958) @@ -690,13 +690,15 @@ struct iwn_node_info { uint8_t macaddr[IEEE80211_ADDR_LEN]; uint16_t reserved2; uint8_t id; -#define IWN_ID_BSS 0 +#define IWN_ID_BSS 0 #define IWN_STA_ID 1 -#define IWN_PAN_ID_BCAST 14 +#define IWN_PAN_ID_BCAST 14 #define IWN5000_ID_BROADCAST 15 #define IWN4965_ID_BROADCAST 31 +#define IWN_ID_UNDEFINED (uint8_t)-1 + uint8_t flags; #define IWN_FLAG_SET_KEY (1 << 0) #define IWN_FLAG_SET_DISABLE_TID (1 << 1)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703251557.v2PFvmhP060893>