[haiku-commits] r41222 - haiku/vendor/freebsd/current/dev/bwi

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 11 Apr 2011 20:02:56 +0200 (CEST)

Author: korli
Date: 2011-04-11 20:02:55 +0200 (Mon, 11 Apr 2011)
New Revision: 41222
Changeset: https://dev.haiku-os.org/changeset/41222

Modified:
   haiku/vendor/freebsd/current/dev/bwi/if_bwi.c
   haiku/vendor/freebsd/current/dev/bwi/if_bwi_pci.c
   haiku/vendor/freebsd/current/dev/bwi/if_bwivar.h
Log:
updating to FreeBSD 8.2 release

Modified: haiku/vendor/freebsd/current/dev/bwi/if_bwi.c
===================================================================
--- haiku/vendor/freebsd/current/dev/bwi/if_bwi.c       2011-04-11 18:02:47 UTC 
(rev 41221)
+++ haiku/vendor/freebsd/current/dev/bwi/if_bwi.c       2011-04-11 18:02:55 UTC 
(rev 41222)
@@ -64,8 +64,8 @@
 #include <net80211/ieee80211_var.h>
 #include <net80211/ieee80211_radiotap.h>
 #include <net80211/ieee80211_regdomain.h>
-#include <net80211/ieee80211_amrr.h>
 #include <net80211/ieee80211_phy.h>
+#include <net80211/ieee80211_ratectl.h>
 
 #include <net/bpf.h>
 
@@ -112,9 +112,6 @@
 static void    bwi_scan_end(struct ieee80211com *);
 static int     bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void    bwi_updateslot(struct ifnet *);
-static struct ieee80211_node *bwi_node_alloc(struct ieee80211vap *,
-                   const uint8_t [IEEE80211_ADDR_LEN]);
-static void    bwi_newassoc(struct ieee80211_node *, int);
 static int     bwi_media_change(struct ifnet *);
 
 static void    bwi_calibrate(void *);
@@ -465,8 +462,8 @@
        ifp->if_ioctl = bwi_ioctl;
        ifp->if_start = bwi_start;
        ifp->if_watchdog = bwi_watchdog;
-       IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
-       ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+       IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+       ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
        IFQ_SET_READY(&ifp->if_snd);
 
        /*
@@ -525,7 +522,6 @@
        ic->ic_vap_delete = bwi_vap_delete;
        ic->ic_raw_xmit = bwi_raw_xmit;
        ic->ic_updateslot = bwi_updateslot;
-       ic->ic_node_alloc = bwi_node_alloc;
        ic->ic_scan_start = bwi_scan_start;
        ic->ic_scan_end = bwi_scan_end;
        ic->ic_set_channel = bwi_set_channel;
@@ -620,10 +616,7 @@
 #if 0
        vap->iv_update_beacon = bwi_beacon_update;
 #endif
-       ieee80211_amrr_init(&bvp->bv_amrr, vap,
-           IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-           IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-           500 /*ms*/);
+       ieee80211_ratectl_init(vap);
 
        /* complete setup */
        ieee80211_vap_attach(vap, bwi_media_change, ieee80211_media_status);
@@ -636,7 +629,7 @@
 {
        struct bwi_vap *bvp = BWI_VAP(vap);
 
-       ieee80211_amrr_cleanup(&bvp->bv_amrr);
+       ieee80211_ratectl_deinit(vap);
        ieee80211_vap_detach(vap);
        free(bvp, M_80211_VAP);
 }
@@ -1776,7 +1769,6 @@
        enum ieee80211_state ostate = vap->iv_state;
        struct bwi_softc *sc = ifp->if_softc;
        struct bwi_mac *mac;
-       struct ieee80211_node *ni = vap->iv_bss;
        int error;
 
        BWI_LOCK(sc);
@@ -1824,10 +1816,6 @@
 #else
                sc->sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
-               if (vap->iv_opmode == IEEE80211_M_STA) {
-                       /* fake a join to init the tx rate */
-                       bwi_newassoc(ni, 1);
-               }
 
                callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc);
        }
@@ -1837,25 +1825,6 @@
        return error;
 }
 
-/* ARGUSED */
-static struct ieee80211_node *
-bwi_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
-{
-       struct bwi_node *bn;
-
-       bn = malloc(sizeof(struct bwi_node), M_80211_NODE, M_NOWAIT | M_ZERO);
-       return bn != NULL ? &bn->ni : NULL;
-}
-
-static void
-bwi_newassoc(struct ieee80211_node *ni, int isnew)
-{
-       struct ieee80211vap *vap = ni->ni_vap;
-
-       ieee80211_amrr_node_init(&BWI_VAP(vap)->bv_amrr,
-           &BWI_NODE(ni)->amn, ni);
-}
-
 static int
 bwi_media_change(struct ifnet *ifp)
 {
@@ -3007,7 +2976,7 @@
        } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
                rate = rate_fb = tp->ucastrate;
        } else {
-               rix = ieee80211_amrr_choose(ni, &BWI_NODE(ni)->amn);
+               rix = ieee80211_ratectl_rate(ni, NULL, pkt_len);
                rate = ni->ni_txrate;
 
                if (rix > 0) {
@@ -3364,6 +3333,7 @@
        struct bwi_txbuf *tb;
        int ring_idx, buf_idx;
        struct ieee80211_node *ni;
+       struct ieee80211vap *vap;
 
        if (tx_id == 0) {
                if_printf(ifp, "%s: zero tx id\n", __func__);
@@ -3389,9 +3359,9 @@
 
        ni = tb->tb_ni;
        if (tb->tb_ni != NULL) {
-               struct bwi_node *bn = (struct bwi_node *) tb->tb_ni;
                const struct bwi_txbuf_hdr *hdr =
                    mtod(tb->tb_mbuf, const struct bwi_txbuf_hdr *);
+               vap = ni->ni_vap;
 
                /* NB: update rate control only for unicast frames */
                if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) {
@@ -3402,8 +3372,9 @@
                         * well so to avoid over-aggressive downshifting we
                         * treat any number of retries as "1".
                         */
-                       ieee80211_amrr_tx_complete(&bn->amn, acked,
-                           data_txcnt > 1);
+                       ieee80211_ratectl_tx_complete(vap, ni,
+                           (data_txcnt > 1) ? IEEE80211_RATECTL_TX_SUCCESS :
+                               IEEE80211_RATECTL_TX_FAILURE, &acked, NULL);
                }
 
                /*

Modified: haiku/vendor/freebsd/current/dev/bwi/if_bwi_pci.c
===================================================================
--- haiku/vendor/freebsd/current/dev/bwi/if_bwi_pci.c   2011-04-11 18:02:47 UTC 
(rev 41221)
+++ haiku/vendor/freebsd/current/dev/bwi/if_bwi_pci.c   2011-04-11 18:02:55 UTC 
(rev 41222)
@@ -91,7 +91,8 @@
        { PCI_VENDOR_BROADCOM, 0x4324,"Broadcom BCM4309 802.11a/b/g Wireless 
Lan" },
        { PCI_VENDOR_BROADCOM, 0x4318,"Broadcom BCM4318 802.11b/g Wireless Lan" 
},
        { PCI_VENDOR_BROADCOM, 0x4319,"Broadcom BCM4318 802.11a/b/g Wireless 
Lan" },
-       { PCI_VENDOR_BROADCOM, 0x431a,"Broadcom BCM4318 802.11a Wireless Lan" }
+       { PCI_VENDOR_BROADCOM, 0x431a,"Broadcom BCM4318 802.11a Wireless Lan" },
+       { 0, 0, NULL }
 };
 
 static int

Modified: haiku/vendor/freebsd/current/dev/bwi/if_bwivar.h
===================================================================
--- haiku/vendor/freebsd/current/dev/bwi/if_bwivar.h    2011-04-11 18:02:47 UTC 
(rev 41221)
+++ haiku/vendor/freebsd/current/dev/bwi/if_bwivar.h    2011-04-11 18:02:55 UTC 
(rev 41222)
@@ -533,15 +533,8 @@
        /* TODO: sq */
 };
 
-struct bwi_node {
-       struct ieee80211_node           ni;     /* must be the first */
-       struct ieee80211_amrr_node      amn;
-};
-#define        BWI_NODE(ni)    ((struct bwi_node *)(ni))
-
 struct bwi_vap {
        struct ieee80211vap     bv_vap;
-       struct ieee80211_amrr   bv_amrr;
        int                     (*bv_newstate)(struct ieee80211vap *,
                                    enum ieee80211_state, int);
 };


Other related posts:

  • » [haiku-commits] r41222 - haiku/vendor/freebsd/current/dev/bwi - korli