staging: brcm80211: change interface for common rssi compute function
authorArend van Spriel <arend@broadcom.com>
Thu, 29 Sep 2011 22:34:30 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 23:12:31 +0000 (16:12 -0700)
The function wlc_phy_rssi_compute() now uses d11rxhdr struct as
purely input parameter and returns the computed rssi value.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/main.c
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h

index e34b5119a63fb95e6ab3c3fa8c39677bcf536df5..ef96358ed995fa7a3e429a4504acd94fa051f440 100644 (file)
@@ -806,15 +806,17 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
 
        /* process each frame */
        while ((p = head) != NULL) {
+               struct d11rxhdr *rxh;
                head = head->prev;
                p->prev = NULL;
 
                wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
+               rxh = (struct d11rxhdr *)p->data;
 
                /*
                 * compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
                 */
-               wlc_phy_rssi_compute(wlc_hw->band->pi, wlc_rxhdr);
+               wlc_rxhdr->rssi = wlc_phy_rssi_compute(wlc_hw->band->pi, rxh);
 
                brcms_c_recv(wlc_hw->wlc, p);
        }
index 80252478c5f2d0aa6a0fac44f581f71e84ac663b..c359a10ca126f2f3a589fd0763234c56821f37e0 100644 (file)
@@ -2610,10 +2610,9 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
        }
 }
 
-void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
-                         struct brcms_d11rxhdr *wlc_rxhdr)
+int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+                        struct d11rxhdr *rxh)
 {
-       struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
        int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
        uint radioid = pih->radioid;
        struct brcms_phy *pi = (struct brcms_phy *) pih;
@@ -2650,7 +2649,7 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
        }
 
 end:
-       wlc_rxhdr->rssi = (s8) rssi;
+       return rssi;
 }
 
 void wlc_phy_freqtrack_start(struct brcms_phy_pub *pih)
index 1dbfaa3522beac43484655c30bc3e2c6c15827ca..39c3c2248e0cab20affe9f046b3f6ad5977b4ccb 100644 (file)
@@ -212,8 +212,8 @@ extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
 extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
 extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
 
-extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
-                                struct brcms_d11rxhdr *wlc_rxhdr);
+extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+                               struct d11rxhdr *rxh);
 extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
 extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
 extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);