Deleted Added
full compact
if_mwl.c (228621) if_mwl.c (234324)
1/*-
2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2007-2008 Marvell Semiconductor, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGES.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2007-2008 Marvell Semiconductor, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGES.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/mwl/if_mwl.c 228621 2011-12-17 10:23:17Z bschmidt $");
32__FBSDID("$FreeBSD: head/sys/dev/mwl/if_mwl.c 234324 2012-04-15 20:29:39Z adrian $");
33
34/*
35 * Driver for the Marvell 88W8363 Wireless LAN controller.
36 */
37
38#include "opt_inet.h"
39#include "opt_mwl.h"
40

--- 3693 unchanged lines hidden (view full) ---

3734 DPRINTF(sc, MWL_DEBUG_AMPDU,
3735 "%s: already has max bastreams\n", __func__);
3736 sc->sc_stats.mst_ampdu_reject++;
3737 return 0;
3738 }
3739 /* NB: no held reference to ni */
3740 sp = mwl_hal_bastream_alloc(MWL_VAP(vap)->mv_hvap,
3741 (baparamset & IEEE80211_BAPS_POLICY_IMMEDIATE) != 0,
33
34/*
35 * Driver for the Marvell 88W8363 Wireless LAN controller.
36 */
37
38#include "opt_inet.h"
39#include "opt_mwl.h"
40

--- 3693 unchanged lines hidden (view full) ---

3734 DPRINTF(sc, MWL_DEBUG_AMPDU,
3735 "%s: already has max bastreams\n", __func__);
3736 sc->sc_stats.mst_ampdu_reject++;
3737 return 0;
3738 }
3739 /* NB: no held reference to ni */
3740 sp = mwl_hal_bastream_alloc(MWL_VAP(vap)->mv_hvap,
3741 (baparamset & IEEE80211_BAPS_POLICY_IMMEDIATE) != 0,
3742 ni->ni_macaddr, WME_AC_TO_TID(tap->txa_ac), ni->ni_htparam,
3742 ni->ni_macaddr, tap->txa_tid, ni->ni_htparam,
3743 ni, tap);
3744 if (sp == NULL) {
3745 /*
3746 * No available stream, return 0 so no
3747 * a-mpdu aggregation will be done.
3748 */
3749 DPRINTF(sc, MWL_DEBUG_AMPDU,
3750 "%s: no bastream available\n", __func__);

--- 20 unchanged lines hidden (view full) ---

3771{
3772 struct mwl_softc *sc = ni->ni_ic->ic_ifp->if_softc;
3773 struct mwl_bastate *bas;
3774
3775 bas = tap->txa_private;
3776 if (bas == NULL) {
3777 /* XXX should not happen */
3778 DPRINTF(sc, MWL_DEBUG_AMPDU,
3743 ni, tap);
3744 if (sp == NULL) {
3745 /*
3746 * No available stream, return 0 so no
3747 * a-mpdu aggregation will be done.
3748 */
3749 DPRINTF(sc, MWL_DEBUG_AMPDU,
3750 "%s: no bastream available\n", __func__);

--- 20 unchanged lines hidden (view full) ---

3771{
3772 struct mwl_softc *sc = ni->ni_ic->ic_ifp->if_softc;
3773 struct mwl_bastate *bas;
3774
3775 bas = tap->txa_private;
3776 if (bas == NULL) {
3777 /* XXX should not happen */
3778 DPRINTF(sc, MWL_DEBUG_AMPDU,
3779 "%s: no BA stream allocated, AC %d\n",
3780 __func__, tap->txa_ac);
3779 "%s: no BA stream allocated, TID %d\n",
3780 __func__, tap->txa_tid);
3781 sc->sc_stats.mst_addba_nostream++;
3782 return 0;
3783 }
3784 if (code == IEEE80211_STATUS_SUCCESS) {
3785 struct ieee80211vap *vap = ni->ni_vap;
3786 int bufsiz, error;
3787
3788 /*

--- 11 unchanged lines hidden (view full) ---

3800 * Setup failed, return immediately so no a-mpdu
3801 * aggregation will be done.
3802 */
3803 mwl_hal_bastream_destroy(sc->sc_mh, bas->bastream);
3804 mwl_bastream_free(bas);
3805 tap->txa_private = NULL;
3806
3807 DPRINTF(sc, MWL_DEBUG_AMPDU,
3781 sc->sc_stats.mst_addba_nostream++;
3782 return 0;
3783 }
3784 if (code == IEEE80211_STATUS_SUCCESS) {
3785 struct ieee80211vap *vap = ni->ni_vap;
3786 int bufsiz, error;
3787
3788 /*

--- 11 unchanged lines hidden (view full) ---

3800 * Setup failed, return immediately so no a-mpdu
3801 * aggregation will be done.
3802 */
3803 mwl_hal_bastream_destroy(sc->sc_mh, bas->bastream);
3804 mwl_bastream_free(bas);
3805 tap->txa_private = NULL;
3806
3807 DPRINTF(sc, MWL_DEBUG_AMPDU,
3808 "%s: create failed, error %d, bufsiz %d AC %d "
3808 "%s: create failed, error %d, bufsiz %d TID %d "
3809 "htparam 0x%x\n", __func__, error, bufsiz,
3809 "htparam 0x%x\n", __func__, error, bufsiz,
3810 tap->txa_ac, ni->ni_htparam);
3810 tap->txa_tid, ni->ni_htparam);
3811 sc->sc_stats.mst_bacreate_failed++;
3812 return 0;
3813 }
3814 /* NB: cache txq to avoid ptr indirect */
3811 sc->sc_stats.mst_bacreate_failed++;
3812 return 0;
3813 }
3814 /* NB: cache txq to avoid ptr indirect */
3815 mwl_bastream_setup(bas, tap->txa_ac, bas->bastream->txq);
3815 mwl_bastream_setup(bas, tap->txa_tid, bas->bastream->txq);
3816 DPRINTF(sc, MWL_DEBUG_AMPDU,
3816 DPRINTF(sc, MWL_DEBUG_AMPDU,
3817 "%s: bastream %p assigned to txq %d AC %d bufsiz %d "
3817 "%s: bastream %p assigned to txq %d TID %d bufsiz %d "
3818 "htparam 0x%x\n", __func__, bas->bastream,
3818 "htparam 0x%x\n", __func__, bas->bastream,
3819 bas->txq, tap->txa_ac, bufsiz, ni->ni_htparam);
3819 bas->txq, tap->txa_tid, bufsiz, ni->ni_htparam);
3820 } else {
3821 /*
3822 * Other side NAK'd us; return the resources.
3823 */
3824 DPRINTF(sc, MWL_DEBUG_AMPDU,
3825 "%s: request failed with code %d, destroy bastream %p\n",
3826 __func__, code, bas->bastream);
3827 mwl_hal_bastream_destroy(sc->sc_mh, bas->bastream);

--- 1215 unchanged lines hidden ---
3820 } else {
3821 /*
3822 * Other side NAK'd us; return the resources.
3823 */
3824 DPRINTF(sc, MWL_DEBUG_AMPDU,
3825 "%s: request failed with code %d, destroy bastream %p\n",
3826 __func__, code, bas->bastream);
3827 mwl_hal_bastream_destroy(sc->sc_mh, bas->bastream);

--- 1215 unchanged lines hidden ---