rt2661.c (288636) | rt2661.c (289165) |
---|---|
1/* $FreeBSD: head/sys/dev/ral/rt2661.c 288636 2015-10-03 22:12:25Z adrian $ */ | 1/* $FreeBSD: head/sys/dev/ral/rt2661.c 289165 2015-10-12 04:55:20Z adrian $ */ |
2 3/*- 4 * Copyright (c) 2006 5 * Damien Bergamini <damien.bergamini@free.fr> 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 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20#include <sys/cdefs.h> | 2 3/*- 4 * Copyright (c) 2006 5 * Damien Bergamini <damien.bergamini@free.fr> 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 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20#include <sys/cdefs.h> |
21__FBSDID("$FreeBSD: head/sys/dev/ral/rt2661.c 288636 2015-10-03 22:12:25Z adrian $"); | 21__FBSDID("$FreeBSD: head/sys/dev/ral/rt2661.c 289165 2015-10-12 04:55:20Z adrian $"); |
22 23/*- 24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver 25 * http://www.ralinktech.com/ 26 */ 27 28#include <sys/param.h> 29#include <sys/sysctl.h> --- 1601 unchanged lines hidden (view full) --- 1631 struct rt2661_softc *sc = ic->ic_softc; 1632 1633 RAL_LOCK(sc); 1634 1635 /* prevent management frames from being sent if we're not ready */ 1636 if (!(sc->sc_flags & RAL_RUNNING)) { 1637 RAL_UNLOCK(sc); 1638 m_freem(m); | 22 23/*- 24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver 25 * http://www.ralinktech.com/ 26 */ 27 28#include <sys/param.h> 29#include <sys/sysctl.h> --- 1601 unchanged lines hidden (view full) --- 1631 struct rt2661_softc *sc = ic->ic_softc; 1632 1633 RAL_LOCK(sc); 1634 1635 /* prevent management frames from being sent if we're not ready */ 1636 if (!(sc->sc_flags & RAL_RUNNING)) { 1637 RAL_UNLOCK(sc); 1638 m_freem(m); |
1639 ieee80211_free_node(ni); | |
1640 return ENETDOWN; 1641 } 1642 if (sc->mgtq.queued >= RT2661_MGT_RING_COUNT) { 1643 RAL_UNLOCK(sc); 1644 m_freem(m); | 1639 return ENETDOWN; 1640 } 1641 if (sc->mgtq.queued >= RT2661_MGT_RING_COUNT) { 1642 RAL_UNLOCK(sc); 1643 m_freem(m); |
1645 ieee80211_free_node(ni); | |
1646 return ENOBUFS; /* XXX */ 1647 } 1648 1649 /* 1650 * Legacy path; interpret frame contents to decide 1651 * precisely how to send the frame. 1652 * XXX raw path 1653 */ 1654 if (rt2661_tx_mgt(sc, m, ni) != 0) 1655 goto bad; 1656 sc->sc_tx_timer = 5; 1657 1658 RAL_UNLOCK(sc); 1659 1660 return 0; 1661bad: | 1644 return ENOBUFS; /* XXX */ 1645 } 1646 1647 /* 1648 * Legacy path; interpret frame contents to decide 1649 * precisely how to send the frame. 1650 * XXX raw path 1651 */ 1652 if (rt2661_tx_mgt(sc, m, ni) != 0) 1653 goto bad; 1654 sc->sc_tx_timer = 5; 1655 1656 RAL_UNLOCK(sc); 1657 1658 return 0; 1659bad: |
1662 ieee80211_free_node(ni); | |
1663 RAL_UNLOCK(sc); 1664 return EIO; /* XXX */ 1665} 1666 1667static void 1668rt2661_watchdog(void *arg) 1669{ 1670 struct rt2661_softc *sc = (struct rt2661_softc *)arg; --- 1106 unchanged lines hidden --- | 1660 RAL_UNLOCK(sc); 1661 return EIO; /* XXX */ 1662} 1663 1664static void 1665rt2661_watchdog(void *arg) 1666{ 1667 struct rt2661_softc *sc = (struct rt2661_softc *)arg; --- 1106 unchanged lines hidden --- |