if_upgt.c (288667) | if_upgt.c (289165) |
---|---|
1/* $OpenBSD: if_upgt.c,v 1.35 2008/04/16 18:32:15 damien Exp $ */ | 1/* $OpenBSD: if_upgt.c,v 1.35 2008/04/16 18:32:15 damien Exp $ */ |
2/* $FreeBSD: head/sys/dev/usb/wlan/if_upgt.c 288667 2015-10-04 13:40:22Z kevlo $ */ | 2/* $FreeBSD: head/sys/dev/usb/wlan/if_upgt.c 289165 2015-10-12 04:55:20Z adrian $ */ |
3 4/* 5 * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * --- 782 unchanged lines hidden (view full) --- 793 struct ieee80211com *ic = ni->ni_ic; 794 struct upgt_softc *sc = ic->ic_softc; 795 struct upgt_data *data_tx = NULL; 796 797 UPGT_LOCK(sc); 798 /* prevent management frames from being sent if we're not ready */ 799 if (!(sc->sc_flags & UPGT_FLAG_INITDONE)) { 800 m_freem(m); | 3 4/* 5 * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * --- 782 unchanged lines hidden (view full) --- 793 struct ieee80211com *ic = ni->ni_ic; 794 struct upgt_softc *sc = ic->ic_softc; 795 struct upgt_data *data_tx = NULL; 796 797 UPGT_LOCK(sc); 798 /* prevent management frames from being sent if we're not ready */ 799 if (!(sc->sc_flags & UPGT_FLAG_INITDONE)) { 800 m_freem(m); |
801 ieee80211_free_node(ni); | |
802 UPGT_UNLOCK(sc); 803 return ENETDOWN; 804 } 805 806 data_tx = upgt_gettxbuf(sc); 807 if (data_tx == NULL) { | 801 UPGT_UNLOCK(sc); 802 return ENETDOWN; 803 } 804 805 data_tx = upgt_gettxbuf(sc); 806 if (data_tx == NULL) { |
808 ieee80211_free_node(ni); | |
809 m_freem(m); 810 UPGT_UNLOCK(sc); 811 return (ENOBUFS); 812 } 813 814 if (upgt_tx_start(sc, m, ni, data_tx) != 0) { 815 STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, data_tx, next); 816 UPGT_STAT_INC(sc, st_tx_inactive); | 807 m_freem(m); 808 UPGT_UNLOCK(sc); 809 return (ENOBUFS); 810 } 811 812 if (upgt_tx_start(sc, m, ni, data_tx) != 0) { 813 STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, data_tx, next); 814 UPGT_STAT_INC(sc, st_tx_inactive); |
817 ieee80211_free_node(ni); | |
818 UPGT_UNLOCK(sc); 819 return (EIO); 820 } 821 UPGT_UNLOCK(sc); 822 823 sc->sc_tx_timer = 5; 824 return (0); 825} --- 1527 unchanged lines hidden --- | 815 UPGT_UNLOCK(sc); 816 return (EIO); 817 } 818 UPGT_UNLOCK(sc); 819 820 sc->sc_tx_timer = 5; 821 return (0); 822} --- 1527 unchanged lines hidden --- |