if_rsu.c (288414) | if_rsu.c (289165) |
---|---|
1/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */ 2 3/*- 4 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18#include <sys/cdefs.h> | 1/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */ 2 3/*- 4 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18#include <sys/cdefs.h> |
19__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_rsu.c 288414 2015-09-30 05:19:16Z adrian $"); | 19__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_rsu.c 289165 2015-10-12 04:55:20Z adrian $"); |
20 21/* 22 * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU. 23 * 24 * TODO: 25 * o h/w crypto 26 * o hostap / ibss / mesh 27 * o sensible RSSI levels --- 2760 unchanged lines hidden (view full) --- 2788{ 2789 struct ieee80211com *ic = ni->ni_ic; 2790 struct rsu_softc *sc = ic->ic_softc; 2791 struct rsu_data *bf; 2792 2793 /* prevent management frames from being sent if we're not ready */ 2794 if (!sc->sc_running) { 2795 m_freem(m); | 20 21/* 22 * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU. 23 * 24 * TODO: 25 * o h/w crypto 26 * o hostap / ibss / mesh 27 * o sensible RSSI levels --- 2760 unchanged lines hidden (view full) --- 2788{ 2789 struct ieee80211com *ic = ni->ni_ic; 2790 struct rsu_softc *sc = ic->ic_softc; 2791 struct rsu_data *bf; 2792 2793 /* prevent management frames from being sent if we're not ready */ 2794 if (!sc->sc_running) { 2795 m_freem(m); |
2796 ieee80211_free_node(ni); | |
2797 return (ENETDOWN); 2798 } 2799 RSU_LOCK(sc); 2800 bf = rsu_getbuf(sc); 2801 if (bf == NULL) { | 2796 return (ENETDOWN); 2797 } 2798 RSU_LOCK(sc); 2799 bf = rsu_getbuf(sc); 2800 if (bf == NULL) { |
2802 ieee80211_free_node(ni); | |
2803 m_freem(m); 2804 RSU_UNLOCK(sc); 2805 return (ENOBUFS); 2806 } 2807 if (rsu_tx_start(sc, ni, m, bf) != 0) { | 2801 m_freem(m); 2802 RSU_UNLOCK(sc); 2803 return (ENOBUFS); 2804 } 2805 if (rsu_tx_start(sc, ni, m, bf) != 0) { |
2808 ieee80211_free_node(ni); | |
2809 m_freem(m); 2810 rsu_freebuf(sc, bf); 2811 RSU_UNLOCK(sc); 2812 return (EIO); 2813 } 2814 RSU_UNLOCK(sc); 2815 2816 return (0); --- 128 unchanged lines hidden --- | 2806 m_freem(m); 2807 rsu_freebuf(sc, bf); 2808 RSU_UNLOCK(sc); 2809 return (EIO); 2810 } 2811 RSU_UNLOCK(sc); 2812 2813 return (0); --- 128 unchanged lines hidden --- |