Merge 2.6.38-rc5 into staging-next
[deliverable/linux.git] / drivers / staging / brcm80211 / brcmsmac / wlc_mac80211.c
index 5eb41d64bc2363dc09cc9a1a7c247624212c9590..6debd45c796153c019495e348af747d69b5fc658 100644 (file)
@@ -140,16 +140,17 @@ static struct wlc_info *wlc_info_dbg = (struct wlc_info *) (NULL);
  */
 enum {
        IOV_MPC = 1,
+       IOV_RTSTHRESH,
        IOV_QTXPOWER,
        IOV_BCN_LI_BCN,         /* Beacon listen interval in # of beacons */
        IOV_LAST                /* In case of a need to check max ID number */
 };
 
 const bcm_iovar_t wlc_iovars[] = {
-       {"mpc", IOV_MPC, (IOVF_OPEN_ALLOW), IOVT_BOOL, 0},
-       {"qtxpower", IOV_QTXPOWER, (IOVF_WHL | IOVF_OPEN_ALLOW), IOVT_UINT32,
-        0},
-       {"bcn_li_bcn", IOV_BCN_LI_BCN, 0, IOVT_UINT8, 0},
+       {"mpc", IOV_MPC, (0), IOVT_BOOL, 0},
+       {"rtsthresh", IOV_RTSTHRESH, (IOVF_WHL), IOVT_UINT16, 0},
+       {"qtxpower", IOV_QTXPOWER, (IOVF_WHL), IOVT_UINT32, 0},
+       {"bcn_li_bcn", IOV_BCN_LI_BCN, (0), IOVT_UINT8, 0},
        {NULL, 0, 0, 0, 0}
 };
 
@@ -239,6 +240,7 @@ static u16 BCMFASTPATH wlc_d11hdrs_mac80211(struct wlc_info *wlc,
                                               wsec_key_t *key,
                                               ratespec_t rspec_override);
 
+static void wlc_ctrupd_cache(u16 cur_stat, u16 *macstat_snapshot, u32 *macstat);
 static void wlc_bss_default_init(struct wlc_info *wlc);
 static void wlc_ucode_mac_upd(struct wlc_info *wlc);
 static ratespec_t mac80211_wlc_set_nrate(struct wlc_info *wlc,
@@ -2304,10 +2306,6 @@ void wlc_radio_mpc_upd(struct wlc_info *wlc)
  */
 static void wlc_radio_upd(struct wlc_info *wlc)
 {
-       if (wlc->pub->radio_disabled)
-               wlc_radio_disable(wlc);
-       else
-               wlc_radio_enable(wlc);
 }
 
 /* maintain LED behavior in down state */
@@ -2324,6 +2322,14 @@ static void wlc_down_led_upd(struct wlc_info *wlc)
        }
 }
 
+/* update hwradio status and return it */
+bool wlc_check_radio_disabled(struct wlc_info *wlc)
+{
+       wlc_radio_hwdisable_upd(wlc);
+
+       return mboolisset(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE) ? true : false;
+}
+
 void wlc_radio_disable(struct wlc_info *wlc)
 {
        if (!wlc->pub->up) {
@@ -4573,6 +4579,9 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
                 wlc->pub->unit, __func__, IOV_ID(actionid));
        /* Do the actual parameter implementation */
        switch (actionid) {
+       case IOV_SVAL(IOV_RTSTHRESH):
+               wlc->RTSThresh = int_val;
+               break;
 
        case IOV_GVAL(IOV_QTXPOWER):{
                        uint qdbm;
@@ -5137,7 +5146,6 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu,
        fifo = prio2fifo[prio];
 
        ASSERT((uint) skb_headroom(sdu) >= TXOFF);
-       ASSERT(!(sdu->cloned));
        ASSERT(!(sdu->next));
        ASSERT(!(sdu->prev));
        ASSERT(fifo < NFIFO);
@@ -5967,6 +5975,11 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
        txrate[0]->count = 0;
        txrate[1]->count = 0;
 
+       /* (2) PROTECTION, may change rspec */
+       if ((ieee80211_is_data(fc) || ieee80211_is_mgmt(fc)) &&
+           (phylen > wlc->RTSThresh) && !is_multicast_ether_addr(h->addr1))
+               use_rts = true;
+
        /* (3) PLCP: determine PLCP header and MAC duration, fill d11txh_t */
        wlc_compute_plcp(wlc, rspec[0], phylen, plcp);
        wlc_compute_plcp(wlc, rspec[1], phylen, plcp_fallback);
@@ -6314,6 +6327,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
                                                    (u16) newfragthresh;
                                        }
                                }
+#if defined(BCMDBG)
                        } else
                                WL_ERROR("wl%d: %s txop invalid for rate %d\n",
                                         wlc->pub->unit, fifo_names[queue],
@@ -6325,6 +6339,9 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
                                         fifo_names[queue],
                                         phylen, wlc->fragthresh[queue],
                                         dur, wlc->edcf_txop[ac]);
+#else
+                       }
+#endif
                }
        }
 
@@ -6594,7 +6611,9 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
        if (txs->phyerr) {
                WL_ERROR("phyerr 0x%x, rate 0x%x\n",
                         txs->phyerr, txh->MainRates);
+#if defined(BCMDBG)
                wlc_print_txdesc(txh);
+#endif
                wlc_print_txstatus(txs);
        }
 
@@ -8477,3 +8496,16 @@ static void wlc_txq_free(struct wlc_info *wlc, struct osl_info *osh,
 
        kfree(qi);
 }
+
+/*
+ * Flag 'scan in progress' to withold dynamic phy calibration
+ */
+void wlc_scan_start(struct wlc_info *wlc)
+{
+       wlc_phy_hold_upd(wlc->band->pi, PHY_HOLD_FOR_SCAN, true);
+}
+
+void wlc_scan_stop(struct wlc_info *wlc)
+{
+       wlc_phy_hold_upd(wlc->band->pi, PHY_HOLD_FOR_SCAN, false);
+}
This page took 0.028066 seconds and 5 git commands to generate.