diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211')
4 files changed, 87 insertions, 87 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c index 4fb9635d3919..796f5f9d5d5a 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c | |||
@@ -746,7 +746,7 @@ dma64_dd_upd(struct dma_info *di, struct dma64desc *ddring, | |||
746 | /* !! may be called with core in reset */ | 746 | /* !! may be called with core in reset */ |
747 | void dma_detach(struct dma_pub *pub) | 747 | void dma_detach(struct dma_pub *pub) |
748 | { | 748 | { |
749 | struct dma_info *di = (struct dma_info *)pub; | 749 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
750 | 750 | ||
751 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 751 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
752 | 752 | ||
@@ -842,7 +842,7 @@ static void _dma_rxenable(struct dma_info *di) | |||
842 | 842 | ||
843 | void dma_rxinit(struct dma_pub *pub) | 843 | void dma_rxinit(struct dma_pub *pub) |
844 | { | 844 | { |
845 | struct dma_info *di = (struct dma_info *)pub; | 845 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
846 | 846 | ||
847 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 847 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
848 | 848 | ||
@@ -924,7 +924,7 @@ static struct sk_buff *_dma_getnextrxp(struct dma_info *di, bool forceall) | |||
924 | */ | 924 | */ |
925 | int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list) | 925 | int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list) |
926 | { | 926 | { |
927 | struct dma_info *di = (struct dma_info *)pub; | 927 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
928 | struct sk_buff_head dma_frames; | 928 | struct sk_buff_head dma_frames; |
929 | struct sk_buff *p, *next; | 929 | struct sk_buff *p, *next; |
930 | uint len; | 930 | uint len; |
@@ -1022,7 +1022,7 @@ static bool dma64_txidle(struct dma_info *di) | |||
1022 | */ | 1022 | */ |
1023 | bool dma_rxfill(struct dma_pub *pub) | 1023 | bool dma_rxfill(struct dma_pub *pub) |
1024 | { | 1024 | { |
1025 | struct dma_info *di = (struct dma_info *)pub; | 1025 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1026 | struct sk_buff *p; | 1026 | struct sk_buff *p; |
1027 | u16 rxin, rxout; | 1027 | u16 rxin, rxout; |
1028 | u32 flags = 0; | 1028 | u32 flags = 0; |
@@ -1106,7 +1106,7 @@ bool dma_rxfill(struct dma_pub *pub) | |||
1106 | 1106 | ||
1107 | void dma_rxreclaim(struct dma_pub *pub) | 1107 | void dma_rxreclaim(struct dma_pub *pub) |
1108 | { | 1108 | { |
1109 | struct dma_info *di = (struct dma_info *)pub; | 1109 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1110 | struct sk_buff *p; | 1110 | struct sk_buff *p; |
1111 | 1111 | ||
1112 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 1112 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
@@ -1126,7 +1126,7 @@ void dma_counterreset(struct dma_pub *pub) | |||
1126 | /* get the address of the var in order to change later */ | 1126 | /* get the address of the var in order to change later */ |
1127 | unsigned long dma_getvar(struct dma_pub *pub, const char *name) | 1127 | unsigned long dma_getvar(struct dma_pub *pub, const char *name) |
1128 | { | 1128 | { |
1129 | struct dma_info *di = (struct dma_info *)pub; | 1129 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1130 | 1130 | ||
1131 | if (!strcmp(name, "&txavail")) | 1131 | if (!strcmp(name, "&txavail")) |
1132 | return (unsigned long)&(di->dma.txavail); | 1132 | return (unsigned long)&(di->dma.txavail); |
@@ -1137,7 +1137,7 @@ unsigned long dma_getvar(struct dma_pub *pub, const char *name) | |||
1137 | 1137 | ||
1138 | void dma_txinit(struct dma_pub *pub) | 1138 | void dma_txinit(struct dma_pub *pub) |
1139 | { | 1139 | { |
1140 | struct dma_info *di = (struct dma_info *)pub; | 1140 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1141 | u32 control = D64_XC_XE; | 1141 | u32 control = D64_XC_XE; |
1142 | 1142 | ||
1143 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 1143 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
@@ -1170,7 +1170,7 @@ void dma_txinit(struct dma_pub *pub) | |||
1170 | 1170 | ||
1171 | void dma_txsuspend(struct dma_pub *pub) | 1171 | void dma_txsuspend(struct dma_pub *pub) |
1172 | { | 1172 | { |
1173 | struct dma_info *di = (struct dma_info *)pub; | 1173 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1174 | 1174 | ||
1175 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 1175 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
1176 | 1176 | ||
@@ -1182,7 +1182,7 @@ void dma_txsuspend(struct dma_pub *pub) | |||
1182 | 1182 | ||
1183 | void dma_txresume(struct dma_pub *pub) | 1183 | void dma_txresume(struct dma_pub *pub) |
1184 | { | 1184 | { |
1185 | struct dma_info *di = (struct dma_info *)pub; | 1185 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1186 | 1186 | ||
1187 | brcms_dbg_dma(di->core, "%s:\n", di->name); | 1187 | brcms_dbg_dma(di->core, "%s:\n", di->name); |
1188 | 1188 | ||
@@ -1194,7 +1194,7 @@ void dma_txresume(struct dma_pub *pub) | |||
1194 | 1194 | ||
1195 | bool dma_txsuspended(struct dma_pub *pub) | 1195 | bool dma_txsuspended(struct dma_pub *pub) |
1196 | { | 1196 | { |
1197 | struct dma_info *di = (struct dma_info *)pub; | 1197 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1198 | 1198 | ||
1199 | return (di->ntxd == 0) || | 1199 | return (di->ntxd == 0) || |
1200 | ((bcma_read32(di->core, | 1200 | ((bcma_read32(di->core, |
@@ -1204,7 +1204,7 @@ bool dma_txsuspended(struct dma_pub *pub) | |||
1204 | 1204 | ||
1205 | void dma_txreclaim(struct dma_pub *pub, enum txd_range range) | 1205 | void dma_txreclaim(struct dma_pub *pub, enum txd_range range) |
1206 | { | 1206 | { |
1207 | struct dma_info *di = (struct dma_info *)pub; | 1207 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1208 | struct sk_buff *p; | 1208 | struct sk_buff *p; |
1209 | 1209 | ||
1210 | brcms_dbg_dma(di->core, "%s: %s\n", | 1210 | brcms_dbg_dma(di->core, "%s: %s\n", |
@@ -1225,7 +1225,7 @@ void dma_txreclaim(struct dma_pub *pub, enum txd_range range) | |||
1225 | 1225 | ||
1226 | bool dma_txreset(struct dma_pub *pub) | 1226 | bool dma_txreset(struct dma_pub *pub) |
1227 | { | 1227 | { |
1228 | struct dma_info *di = (struct dma_info *)pub; | 1228 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1229 | u32 status; | 1229 | u32 status; |
1230 | 1230 | ||
1231 | if (di->ntxd == 0) | 1231 | if (di->ntxd == 0) |
@@ -1252,7 +1252,7 @@ bool dma_txreset(struct dma_pub *pub) | |||
1252 | 1252 | ||
1253 | bool dma_rxreset(struct dma_pub *pub) | 1253 | bool dma_rxreset(struct dma_pub *pub) |
1254 | { | 1254 | { |
1255 | struct dma_info *di = (struct dma_info *)pub; | 1255 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1256 | u32 status; | 1256 | u32 status; |
1257 | 1257 | ||
1258 | if (di->nrxd == 0) | 1258 | if (di->nrxd == 0) |
@@ -1377,7 +1377,7 @@ static void dma_update_txavail(struct dma_info *di) | |||
1377 | int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub, | 1377 | int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub, |
1378 | struct sk_buff *p) | 1378 | struct sk_buff *p) |
1379 | { | 1379 | { |
1380 | struct dma_info *di = (struct dma_info *)pub; | 1380 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1381 | struct brcms_ampdu_session *session = &di->ampdu_session; | 1381 | struct brcms_ampdu_session *session = &di->ampdu_session; |
1382 | struct ieee80211_tx_info *tx_info; | 1382 | struct ieee80211_tx_info *tx_info; |
1383 | bool is_ampdu; | 1383 | bool is_ampdu; |
@@ -1427,7 +1427,7 @@ int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub, | |||
1427 | 1427 | ||
1428 | void dma_txflush(struct dma_pub *pub) | 1428 | void dma_txflush(struct dma_pub *pub) |
1429 | { | 1429 | { |
1430 | struct dma_info *di = (struct dma_info *)pub; | 1430 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1431 | struct brcms_ampdu_session *session = &di->ampdu_session; | 1431 | struct brcms_ampdu_session *session = &di->ampdu_session; |
1432 | 1432 | ||
1433 | if (!skb_queue_empty(&session->skb_list)) | 1433 | if (!skb_queue_empty(&session->skb_list)) |
@@ -1436,7 +1436,7 @@ void dma_txflush(struct dma_pub *pub) | |||
1436 | 1436 | ||
1437 | int dma_txpending(struct dma_pub *pub) | 1437 | int dma_txpending(struct dma_pub *pub) |
1438 | { | 1438 | { |
1439 | struct dma_info *di = (struct dma_info *)pub; | 1439 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1440 | return ntxdactive(di, di->txin, di->txout); | 1440 | return ntxdactive(di, di->txin, di->txout); |
1441 | } | 1441 | } |
1442 | 1442 | ||
@@ -1446,7 +1446,7 @@ int dma_txpending(struct dma_pub *pub) | |||
1446 | */ | 1446 | */ |
1447 | void dma_kick_tx(struct dma_pub *pub) | 1447 | void dma_kick_tx(struct dma_pub *pub) |
1448 | { | 1448 | { |
1449 | struct dma_info *di = (struct dma_info *)pub; | 1449 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1450 | struct brcms_ampdu_session *session = &di->ampdu_session; | 1450 | struct brcms_ampdu_session *session = &di->ampdu_session; |
1451 | 1451 | ||
1452 | if (!skb_queue_empty(&session->skb_list) && dma64_txidle(di)) | 1452 | if (!skb_queue_empty(&session->skb_list) && dma64_txidle(di)) |
@@ -1465,7 +1465,7 @@ void dma_kick_tx(struct dma_pub *pub) | |||
1465 | */ | 1465 | */ |
1466 | struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range) | 1466 | struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range) |
1467 | { | 1467 | { |
1468 | struct dma_info *di = (struct dma_info *)pub; | 1468 | struct dma_info *di = container_of(pub, struct dma_info, dma); |
1469 | u16 start, end, i; | 1469 | u16 start, end, i; |
1470 | u16 active_desc; | 1470 | u16 active_desc; |
1471 | struct sk_buff *txp; | 1471 | struct sk_buff *txp; |
@@ -1547,7 +1547,7 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range) | |||
1547 | void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc) | 1547 | void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc) |
1548 | (void *pkt, void *arg_a), void *arg_a) | 1548 | (void *pkt, void *arg_a), void *arg_a) |
1549 | { | 1549 | { |
1550 | struct dma_info *di = (struct dma_info *) dmah; | 1550 | struct dma_info *di = container_of(dmah, struct dma_info, dma); |
1551 | uint i = di->txin; | 1551 | uint i = di->txin; |
1552 | uint end = di->txout; | 1552 | uint end = di->txout; |
1553 | struct sk_buff *skb; | 1553 | struct sk_buff *skb; |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c index 57ecc05802e9..941b1e41f366 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c | |||
@@ -128,19 +128,19 @@ static const u8 ofdm_rate_lookup[] = { | |||
128 | 128 | ||
129 | void wlc_phyreg_enter(struct brcms_phy_pub *pih) | 129 | void wlc_phyreg_enter(struct brcms_phy_pub *pih) |
130 | { | 130 | { |
131 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 131 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
132 | wlapi_bmac_ucode_wake_override_phyreg_set(pi->sh->physhim); | 132 | wlapi_bmac_ucode_wake_override_phyreg_set(pi->sh->physhim); |
133 | } | 133 | } |
134 | 134 | ||
135 | void wlc_phyreg_exit(struct brcms_phy_pub *pih) | 135 | void wlc_phyreg_exit(struct brcms_phy_pub *pih) |
136 | { | 136 | { |
137 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 137 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
138 | wlapi_bmac_ucode_wake_override_phyreg_clear(pi->sh->physhim); | 138 | wlapi_bmac_ucode_wake_override_phyreg_clear(pi->sh->physhim); |
139 | } | 139 | } |
140 | 140 | ||
141 | void wlc_radioreg_enter(struct brcms_phy_pub *pih) | 141 | void wlc_radioreg_enter(struct brcms_phy_pub *pih) |
142 | { | 142 | { |
143 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 143 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
144 | wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO); | 144 | wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO); |
145 | 145 | ||
146 | udelay(10); | 146 | udelay(10); |
@@ -148,7 +148,7 @@ void wlc_radioreg_enter(struct brcms_phy_pub *pih) | |||
148 | 148 | ||
149 | void wlc_radioreg_exit(struct brcms_phy_pub *pih) | 149 | void wlc_radioreg_exit(struct brcms_phy_pub *pih) |
150 | { | 150 | { |
151 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 151 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
152 | 152 | ||
153 | (void)bcma_read16(pi->d11core, D11REGOFFS(phyversion)); | 153 | (void)bcma_read16(pi->d11core, D11REGOFFS(phyversion)); |
154 | pi->phy_wreg = 0; | 154 | pi->phy_wreg = 0; |
@@ -586,7 +586,7 @@ err: | |||
586 | 586 | ||
587 | void wlc_phy_detach(struct brcms_phy_pub *pih) | 587 | void wlc_phy_detach(struct brcms_phy_pub *pih) |
588 | { | 588 | { |
589 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 589 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
590 | 590 | ||
591 | if (pih) { | 591 | if (pih) { |
592 | if (--pi->refcnt) | 592 | if (--pi->refcnt) |
@@ -613,7 +613,7 @@ bool | |||
613 | wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype, u16 *phyrev, | 613 | wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype, u16 *phyrev, |
614 | u16 *radioid, u16 *radiover) | 614 | u16 *radioid, u16 *radiover) |
615 | { | 615 | { |
616 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 616 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
617 | *phytype = (u16) pi->pubpi.phy_type; | 617 | *phytype = (u16) pi->pubpi.phy_type; |
618 | *phyrev = (u16) pi->pubpi.phy_rev; | 618 | *phyrev = (u16) pi->pubpi.phy_rev; |
619 | *radioid = pi->pubpi.radioid; | 619 | *radioid = pi->pubpi.radioid; |
@@ -624,19 +624,19 @@ wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype, u16 *phyrev, | |||
624 | 624 | ||
625 | bool wlc_phy_get_encore(struct brcms_phy_pub *pih) | 625 | bool wlc_phy_get_encore(struct brcms_phy_pub *pih) |
626 | { | 626 | { |
627 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 627 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
628 | return pi->pubpi.abgphy_encore; | 628 | return pi->pubpi.abgphy_encore; |
629 | } | 629 | } |
630 | 630 | ||
631 | u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih) | 631 | u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih) |
632 | { | 632 | { |
633 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 633 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
634 | return pi->pubpi.coreflags; | 634 | return pi->pubpi.coreflags; |
635 | } | 635 | } |
636 | 636 | ||
637 | void wlc_phy_anacore(struct brcms_phy_pub *pih, bool on) | 637 | void wlc_phy_anacore(struct brcms_phy_pub *pih, bool on) |
638 | { | 638 | { |
639 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 639 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
640 | 640 | ||
641 | if (ISNPHY(pi)) { | 641 | if (ISNPHY(pi)) { |
642 | if (on) { | 642 | if (on) { |
@@ -673,7 +673,7 @@ void wlc_phy_anacore(struct brcms_phy_pub *pih, bool on) | |||
673 | 673 | ||
674 | u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih) | 674 | u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih) |
675 | { | 675 | { |
676 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 676 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
677 | 677 | ||
678 | u32 phy_bw_clkbits = 0; | 678 | u32 phy_bw_clkbits = 0; |
679 | 679 | ||
@@ -698,14 +698,14 @@ u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih) | |||
698 | 698 | ||
699 | void wlc_phy_por_inform(struct brcms_phy_pub *ppi) | 699 | void wlc_phy_por_inform(struct brcms_phy_pub *ppi) |
700 | { | 700 | { |
701 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 701 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
702 | 702 | ||
703 | pi->phy_init_por = true; | 703 | pi->phy_init_por = true; |
704 | } | 704 | } |
705 | 705 | ||
706 | void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock) | 706 | void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock) |
707 | { | 707 | { |
708 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 708 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
709 | 709 | ||
710 | pi->edcrs_threshold_lock = lock; | 710 | pi->edcrs_threshold_lock = lock; |
711 | 711 | ||
@@ -717,14 +717,14 @@ void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock) | |||
717 | 717 | ||
718 | void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal) | 718 | void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal) |
719 | { | 719 | { |
720 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 720 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
721 | 721 | ||
722 | pi->do_initcal = initcal; | 722 | pi->do_initcal = initcal; |
723 | } | 723 | } |
724 | 724 | ||
725 | void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *pih, bool newstate) | 725 | void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *pih, bool newstate) |
726 | { | 726 | { |
727 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 727 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
728 | 728 | ||
729 | if (!pi || !pi->sh) | 729 | if (!pi || !pi->sh) |
730 | return; | 730 | return; |
@@ -734,7 +734,7 @@ void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *pih, bool newstate) | |||
734 | 734 | ||
735 | void wlc_phy_hw_state_upd(struct brcms_phy_pub *pih, bool newstate) | 735 | void wlc_phy_hw_state_upd(struct brcms_phy_pub *pih, bool newstate) |
736 | { | 736 | { |
737 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 737 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
738 | 738 | ||
739 | if (!pi || !pi->sh) | 739 | if (!pi || !pi->sh) |
740 | return; | 740 | return; |
@@ -746,7 +746,7 @@ void wlc_phy_init(struct brcms_phy_pub *pih, u16 chanspec) | |||
746 | { | 746 | { |
747 | u32 mc; | 747 | u32 mc; |
748 | void (*phy_init)(struct brcms_phy *) = NULL; | 748 | void (*phy_init)(struct brcms_phy *) = NULL; |
749 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 749 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
750 | 750 | ||
751 | if (pi->init_in_progress) | 751 | if (pi->init_in_progress) |
752 | return; | 752 | return; |
@@ -798,7 +798,7 @@ void wlc_phy_init(struct brcms_phy_pub *pih, u16 chanspec) | |||
798 | 798 | ||
799 | void wlc_phy_cal_init(struct brcms_phy_pub *pih) | 799 | void wlc_phy_cal_init(struct brcms_phy_pub *pih) |
800 | { | 800 | { |
801 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 801 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
802 | void (*cal_init)(struct brcms_phy *) = NULL; | 802 | void (*cal_init)(struct brcms_phy *) = NULL; |
803 | 803 | ||
804 | if (WARN((bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & | 804 | if (WARN((bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & |
@@ -816,7 +816,7 @@ void wlc_phy_cal_init(struct brcms_phy_pub *pih) | |||
816 | 816 | ||
817 | int wlc_phy_down(struct brcms_phy_pub *pih) | 817 | int wlc_phy_down(struct brcms_phy_pub *pih) |
818 | { | 818 | { |
819 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 819 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
820 | int callbacks = 0; | 820 | int callbacks = 0; |
821 | 821 | ||
822 | if (pi->phycal_timer | 822 | if (pi->phycal_timer |
@@ -1070,7 +1070,7 @@ void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on) | |||
1070 | 1070 | ||
1071 | void wlc_phy_hold_upd(struct brcms_phy_pub *pih, u32 id, bool set) | 1071 | void wlc_phy_hold_upd(struct brcms_phy_pub *pih, u32 id, bool set) |
1072 | { | 1072 | { |
1073 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1073 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1074 | 1074 | ||
1075 | if (set) | 1075 | if (set) |
1076 | mboolset(pi->measure_hold, id); | 1076 | mboolset(pi->measure_hold, id); |
@@ -1082,7 +1082,7 @@ void wlc_phy_hold_upd(struct brcms_phy_pub *pih, u32 id, bool set) | |||
1082 | 1082 | ||
1083 | void wlc_phy_mute_upd(struct brcms_phy_pub *pih, bool mute, u32 flags) | 1083 | void wlc_phy_mute_upd(struct brcms_phy_pub *pih, bool mute, u32 flags) |
1084 | { | 1084 | { |
1085 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1085 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1086 | 1086 | ||
1087 | if (mute) | 1087 | if (mute) |
1088 | mboolset(pi->measure_hold, PHY_HOLD_FOR_MUTE); | 1088 | mboolset(pi->measure_hold, PHY_HOLD_FOR_MUTE); |
@@ -1096,7 +1096,7 @@ void wlc_phy_mute_upd(struct brcms_phy_pub *pih, bool mute, u32 flags) | |||
1096 | 1096 | ||
1097 | void wlc_phy_clear_tssi(struct brcms_phy_pub *pih) | 1097 | void wlc_phy_clear_tssi(struct brcms_phy_pub *pih) |
1098 | { | 1098 | { |
1099 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1099 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1100 | 1100 | ||
1101 | if (ISNPHY(pi)) { | 1101 | if (ISNPHY(pi)) { |
1102 | return; | 1102 | return; |
@@ -1115,7 +1115,7 @@ static bool wlc_phy_cal_txpower_recalc_sw(struct brcms_phy *pi) | |||
1115 | 1115 | ||
1116 | void wlc_phy_switch_radio(struct brcms_phy_pub *pih, bool on) | 1116 | void wlc_phy_switch_radio(struct brcms_phy_pub *pih, bool on) |
1117 | { | 1117 | { |
1118 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1118 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1119 | (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); | 1119 | (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)); |
1120 | 1120 | ||
1121 | if (ISNPHY(pi)) { | 1121 | if (ISNPHY(pi)) { |
@@ -1149,35 +1149,35 @@ void wlc_phy_switch_radio(struct brcms_phy_pub *pih, bool on) | |||
1149 | 1149 | ||
1150 | u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi) | 1150 | u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi) |
1151 | { | 1151 | { |
1152 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1152 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1153 | 1153 | ||
1154 | return pi->bw; | 1154 | return pi->bw; |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw) | 1157 | void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw) |
1158 | { | 1158 | { |
1159 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1159 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1160 | 1160 | ||
1161 | pi->bw = bw; | 1161 | pi->bw = bw; |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch) | 1164 | void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch) |
1165 | { | 1165 | { |
1166 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1166 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1167 | pi->radio_chanspec = newch; | 1167 | pi->radio_chanspec = newch; |
1168 | 1168 | ||
1169 | } | 1169 | } |
1170 | 1170 | ||
1171 | u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi) | 1171 | u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi) |
1172 | { | 1172 | { |
1173 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1173 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1174 | 1174 | ||
1175 | return pi->radio_chanspec; | 1175 | return pi->radio_chanspec; |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec) | 1178 | void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec) |
1179 | { | 1179 | { |
1180 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1180 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1181 | u16 m_cur_channel; | 1181 | u16 m_cur_channel; |
1182 | void (*chanspec_set)(struct brcms_phy *, u16) = NULL; | 1182 | void (*chanspec_set)(struct brcms_phy *, u16) = NULL; |
1183 | m_cur_channel = CHSPEC_CHANNEL(chanspec); | 1183 | m_cur_channel = CHSPEC_CHANNEL(chanspec); |
@@ -1226,7 +1226,7 @@ int wlc_phy_chanspec_bandrange_get(struct brcms_phy *pi, u16 chanspec) | |||
1226 | void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi, | 1226 | void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi, |
1227 | bool wide_filter) | 1227 | bool wide_filter) |
1228 | { | 1228 | { |
1229 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1229 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1230 | 1230 | ||
1231 | pi->channel_14_wide_filter = wide_filter; | 1231 | pi->channel_14_wide_filter = wide_filter; |
1232 | 1232 | ||
@@ -1246,7 +1246,7 @@ void | |||
1246 | wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band, | 1246 | wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band, |
1247 | struct brcms_chanvec *channels) | 1247 | struct brcms_chanvec *channels) |
1248 | { | 1248 | { |
1249 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1249 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1250 | uint i; | 1250 | uint i; |
1251 | uint channel; | 1251 | uint channel; |
1252 | 1252 | ||
@@ -1267,7 +1267,7 @@ wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band, | |||
1267 | 1267 | ||
1268 | u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band) | 1268 | u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band) |
1269 | { | 1269 | { |
1270 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1270 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1271 | uint i; | 1271 | uint i; |
1272 | uint channel; | 1272 | uint channel; |
1273 | u16 chspec; | 1273 | u16 chspec; |
@@ -1311,7 +1311,7 @@ u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band) | |||
1311 | 1311 | ||
1312 | int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override) | 1312 | int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override) |
1313 | { | 1313 | { |
1314 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1314 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1315 | 1315 | ||
1316 | *qdbm = pi->tx_user_target[0]; | 1316 | *qdbm = pi->tx_user_target[0]; |
1317 | if (override != NULL) | 1317 | if (override != NULL) |
@@ -1323,7 +1323,7 @@ void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi, | |||
1323 | struct txpwr_limits *txpwr) | 1323 | struct txpwr_limits *txpwr) |
1324 | { | 1324 | { |
1325 | bool mac_enabled = false; | 1325 | bool mac_enabled = false; |
1326 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1326 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1327 | 1327 | ||
1328 | memcpy(&pi->tx_user_target[TXP_FIRST_CCK], | 1328 | memcpy(&pi->tx_user_target[TXP_FIRST_CCK], |
1329 | &txpwr->cck[0], BRCMS_NUM_RATES_CCK); | 1329 | &txpwr->cck[0], BRCMS_NUM_RATES_CCK); |
@@ -1371,7 +1371,7 @@ void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi, | |||
1371 | 1371 | ||
1372 | int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override) | 1372 | int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override) |
1373 | { | 1373 | { |
1374 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1374 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1375 | int i; | 1375 | int i; |
1376 | 1376 | ||
1377 | if (qdbm > 127) | 1377 | if (qdbm > 127) |
@@ -1407,7 +1407,7 @@ void | |||
1407 | wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint channel, u8 *min_pwr, | 1407 | wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint channel, u8 *min_pwr, |
1408 | u8 *max_pwr, int txp_rate_idx) | 1408 | u8 *max_pwr, int txp_rate_idx) |
1409 | { | 1409 | { |
1410 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1410 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1411 | uint i; | 1411 | uint i; |
1412 | 1412 | ||
1413 | *min_pwr = pi->min_txpower * BRCMS_TXPWR_DB_FACTOR; | 1413 | *min_pwr = pi->min_txpower * BRCMS_TXPWR_DB_FACTOR; |
@@ -1456,7 +1456,7 @@ void | |||
1456 | wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan, | 1456 | wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan, |
1457 | u8 *max_txpwr, u8 *min_txpwr) | 1457 | u8 *max_txpwr, u8 *min_txpwr) |
1458 | { | 1458 | { |
1459 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1459 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1460 | u8 tx_pwr_max = 0; | 1460 | u8 tx_pwr_max = 0; |
1461 | u8 tx_pwr_min = 255; | 1461 | u8 tx_pwr_min = 255; |
1462 | u8 max_num_rate; | 1462 | u8 max_num_rate; |
@@ -1493,14 +1493,14 @@ wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint bandunit, | |||
1493 | 1493 | ||
1494 | u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi) | 1494 | u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi) |
1495 | { | 1495 | { |
1496 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1496 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1497 | 1497 | ||
1498 | return pi->tx_power_min; | 1498 | return pi->tx_power_min; |
1499 | } | 1499 | } |
1500 | 1500 | ||
1501 | u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi) | 1501 | u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi) |
1502 | { | 1502 | { |
1503 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1503 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1504 | 1504 | ||
1505 | return pi->tx_power_max; | 1505 | return pi->tx_power_max; |
1506 | } | 1506 | } |
@@ -1812,21 +1812,21 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr, | |||
1812 | 1812 | ||
1813 | void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent) | 1813 | void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent) |
1814 | { | 1814 | { |
1815 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1815 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1816 | 1816 | ||
1817 | pi->txpwr_percent = txpwr_percent; | 1817 | pi->txpwr_percent = txpwr_percent; |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap) | 1820 | void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap) |
1821 | { | 1821 | { |
1822 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1822 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1823 | 1823 | ||
1824 | pi->sh->machwcap = machwcap; | 1824 | pi->sh->machwcap = machwcap; |
1825 | } | 1825 | } |
1826 | 1826 | ||
1827 | void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end) | 1827 | void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end) |
1828 | { | 1828 | { |
1829 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1829 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1830 | u16 rxc; | 1830 | u16 rxc; |
1831 | rxc = 0; | 1831 | rxc = 0; |
1832 | 1832 | ||
@@ -1857,7 +1857,7 @@ void | |||
1857 | wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *txpwr, | 1857 | wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *txpwr, |
1858 | u16 chanspec) | 1858 | u16 chanspec) |
1859 | { | 1859 | { |
1860 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1860 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1861 | 1861 | ||
1862 | wlc_phy_txpower_reg_limit_calc(pi, txpwr, chanspec); | 1862 | wlc_phy_txpower_reg_limit_calc(pi, txpwr, chanspec); |
1863 | 1863 | ||
@@ -1881,14 +1881,14 @@ wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *txpwr, | |||
1881 | 1881 | ||
1882 | void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war) | 1882 | void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war) |
1883 | { | 1883 | { |
1884 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1884 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1885 | 1885 | ||
1886 | pi->ofdm_rateset_war = war; | 1886 | pi->ofdm_rateset_war = war; |
1887 | } | 1887 | } |
1888 | 1888 | ||
1889 | void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt) | 1889 | void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt) |
1890 | { | 1890 | { |
1891 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 1891 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
1892 | 1892 | ||
1893 | pi->bf_preempt_4306 = bf_preempt; | 1893 | pi->bf_preempt_4306 = bf_preempt; |
1894 | } | 1894 | } |
@@ -1945,7 +1945,7 @@ void wlc_phy_txpower_update_shm(struct brcms_phy *pi) | |||
1945 | 1945 | ||
1946 | bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi) | 1946 | bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi) |
1947 | { | 1947 | { |
1948 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1948 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1949 | 1949 | ||
1950 | if (ISNPHY(pi)) | 1950 | if (ISNPHY(pi)) |
1951 | return pi->nphy_txpwrctrl; | 1951 | return pi->nphy_txpwrctrl; |
@@ -1955,7 +1955,7 @@ bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi) | |||
1955 | 1955 | ||
1956 | void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl) | 1956 | void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl) |
1957 | { | 1957 | { |
1958 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 1958 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
1959 | bool suspend; | 1959 | bool suspend; |
1960 | 1960 | ||
1961 | if (!pi->hwpwrctrl_capable) | 1961 | if (!pi->hwpwrctrl_capable) |
@@ -2038,7 +2038,7 @@ void | |||
2038 | wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, struct tx_power *power, | 2038 | wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, struct tx_power *power, |
2039 | uint channel) | 2039 | uint channel) |
2040 | { | 2040 | { |
2041 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2041 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2042 | uint rate, num_rates; | 2042 | uint rate, num_rates; |
2043 | u8 min_pwr, max_pwr; | 2043 | u8 min_pwr, max_pwr; |
2044 | 2044 | ||
@@ -2136,21 +2136,21 @@ wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, struct tx_power *power, | |||
2136 | 2136 | ||
2137 | void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type) | 2137 | void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type) |
2138 | { | 2138 | { |
2139 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2139 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2140 | 2140 | ||
2141 | pi->antsel_type = antsel_type; | 2141 | pi->antsel_type = antsel_type; |
2142 | } | 2142 | } |
2143 | 2143 | ||
2144 | bool wlc_phy_test_ison(struct brcms_phy_pub *ppi) | 2144 | bool wlc_phy_test_ison(struct brcms_phy_pub *ppi) |
2145 | { | 2145 | { |
2146 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2146 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2147 | 2147 | ||
2148 | return pi->phytest_on; | 2148 | return pi->phytest_on; |
2149 | } | 2149 | } |
2150 | 2150 | ||
2151 | void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val) | 2151 | void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val) |
2152 | { | 2152 | { |
2153 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2153 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2154 | bool suspend; | 2154 | bool suspend; |
2155 | 2155 | ||
2156 | pi->sh->rx_antdiv = val; | 2156 | pi->sh->rx_antdiv = val; |
@@ -2283,7 +2283,7 @@ static s8 wlc_phy_noise_read_shmem(struct brcms_phy *pi) | |||
2283 | 2283 | ||
2284 | void wlc_phy_noise_sample_intr(struct brcms_phy_pub *pih) | 2284 | void wlc_phy_noise_sample_intr(struct brcms_phy_pub *pih) |
2285 | { | 2285 | { |
2286 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2286 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2287 | u16 jssi_aux; | 2287 | u16 jssi_aux; |
2288 | u8 channel = 0; | 2288 | u8 channel = 0; |
2289 | s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY; | 2289 | s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY; |
@@ -2339,7 +2339,7 @@ void wlc_phy_noise_sample_intr(struct brcms_phy_pub *pih) | |||
2339 | static void | 2339 | static void |
2340 | wlc_phy_noise_sample_request(struct brcms_phy_pub *pih, u8 reason, u8 ch) | 2340 | wlc_phy_noise_sample_request(struct brcms_phy_pub *pih, u8 reason, u8 ch) |
2341 | { | 2341 | { |
2342 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2342 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2343 | s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY; | 2343 | s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY; |
2344 | bool sampling_in_progress = (pi->phynoise_state != 0); | 2344 | bool sampling_in_progress = (pi->phynoise_state != 0); |
2345 | bool wait_for_intr = true; | 2345 | bool wait_for_intr = true; |
@@ -2531,7 +2531,7 @@ int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, | |||
2531 | { | 2531 | { |
2532 | int rssi = rxh->PhyRxStatus_1 & PRXS1_JSSI_MASK; | 2532 | int rssi = rxh->PhyRxStatus_1 & PRXS1_JSSI_MASK; |
2533 | uint radioid = pih->radioid; | 2533 | uint radioid = pih->radioid; |
2534 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2534 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2535 | 2535 | ||
2536 | if ((pi->sh->corerev >= 11) | 2536 | if ((pi->sh->corerev >= 11) |
2537 | && !(rxh->RxStatus2 & RXS_PHYRXST_VALID)) { | 2537 | && !(rxh->RxStatus2 & RXS_PHYRXST_VALID)) { |
@@ -2591,7 +2591,7 @@ void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag) | |||
2591 | 2591 | ||
2592 | void wlc_phy_watchdog(struct brcms_phy_pub *pih) | 2592 | void wlc_phy_watchdog(struct brcms_phy_pub *pih) |
2593 | { | 2593 | { |
2594 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2594 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2595 | bool delay_phy_cal = false; | 2595 | bool delay_phy_cal = false; |
2596 | pi->sh->now++; | 2596 | pi->sh->now++; |
2597 | 2597 | ||
@@ -2651,7 +2651,7 @@ void wlc_phy_watchdog(struct brcms_phy_pub *pih) | |||
2651 | 2651 | ||
2652 | void wlc_phy_BSSinit(struct brcms_phy_pub *pih, bool bonlyap, int rssi) | 2652 | void wlc_phy_BSSinit(struct brcms_phy_pub *pih, bool bonlyap, int rssi) |
2653 | { | 2653 | { |
2654 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2654 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2655 | uint i; | 2655 | uint i; |
2656 | uint k; | 2656 | uint k; |
2657 | 2657 | ||
@@ -2711,7 +2711,7 @@ void wlc_phy_cal_perical(struct brcms_phy_pub *pih, u8 reason) | |||
2711 | s16 nphy_currtemp = 0; | 2711 | s16 nphy_currtemp = 0; |
2712 | s16 delta_temp = 0; | 2712 | s16 delta_temp = 0; |
2713 | bool do_periodic_cal = true; | 2713 | bool do_periodic_cal = true; |
2714 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2714 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2715 | 2715 | ||
2716 | if (!ISNPHY(pi)) | 2716 | if (!ISNPHY(pi)) |
2717 | return; | 2717 | return; |
@@ -2804,7 +2804,7 @@ u8 wlc_phy_nbits(s32 value) | |||
2804 | 2804 | ||
2805 | void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) | 2805 | void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) |
2806 | { | 2806 | { |
2807 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2807 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2808 | 2808 | ||
2809 | pi->sh->hw_phytxchain = txchain; | 2809 | pi->sh->hw_phytxchain = txchain; |
2810 | pi->sh->hw_phyrxchain = rxchain; | 2810 | pi->sh->hw_phyrxchain = rxchain; |
@@ -2815,7 +2815,7 @@ void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) | |||
2815 | 2815 | ||
2816 | void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) | 2816 | void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) |
2817 | { | 2817 | { |
2818 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2818 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2819 | 2819 | ||
2820 | pi->sh->phytxchain = txchain; | 2820 | pi->sh->phytxchain = txchain; |
2821 | 2821 | ||
@@ -2827,7 +2827,7 @@ void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain) | |||
2827 | 2827 | ||
2828 | void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain) | 2828 | void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain) |
2829 | { | 2829 | { |
2830 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2830 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2831 | 2831 | ||
2832 | *txchain = pi->sh->phytxchain; | 2832 | *txchain = pi->sh->phytxchain; |
2833 | *rxchain = pi->sh->phyrxchain; | 2833 | *rxchain = pi->sh->phyrxchain; |
@@ -2837,7 +2837,7 @@ u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih) | |||
2837 | { | 2837 | { |
2838 | s16 nphy_currtemp; | 2838 | s16 nphy_currtemp; |
2839 | u8 active_bitmap; | 2839 | u8 active_bitmap; |
2840 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2840 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2841 | 2841 | ||
2842 | active_bitmap = (pi->phy_txcore_heatedup) ? 0x31 : 0x33; | 2842 | active_bitmap = (pi->phy_txcore_heatedup) ? 0x31 : 0x33; |
2843 | 2843 | ||
@@ -2867,7 +2867,7 @@ u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih) | |||
2867 | 2867 | ||
2868 | s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec) | 2868 | s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec) |
2869 | { | 2869 | { |
2870 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 2870 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
2871 | u8 siso_mcs_id, cdd_mcs_id; | 2871 | u8 siso_mcs_id, cdd_mcs_id; |
2872 | 2872 | ||
2873 | siso_mcs_id = | 2873 | siso_mcs_id = |
@@ -2944,7 +2944,7 @@ s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, u16 chanspec) | |||
2944 | 2944 | ||
2945 | bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *ppi) | 2945 | bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *ppi) |
2946 | { | 2946 | { |
2947 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2947 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2948 | 2948 | ||
2949 | if (ISNPHY(pi)) | 2949 | if (ISNPHY(pi)) |
2950 | return wlc_phy_n_txpower_ipa_ison(pi); | 2950 | return wlc_phy_n_txpower_ipa_ison(pi); |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c index b2d6d6da3daf..5f1366234a0d 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | |||
@@ -2865,7 +2865,7 @@ static void wlc_lcnphy_idle_tssi_est(struct brcms_phy_pub *ppi) | |||
2865 | { | 2865 | { |
2866 | bool suspend, tx_gain_override_old; | 2866 | bool suspend, tx_gain_override_old; |
2867 | struct lcnphy_txgains old_gains; | 2867 | struct lcnphy_txgains old_gains; |
2868 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 2868 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
2869 | u16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB, | 2869 | u16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB, |
2870 | idleTssi0_regvalue_2C; | 2870 | idleTssi0_regvalue_2C; |
2871 | u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi); | 2871 | u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi); |
@@ -3084,7 +3084,7 @@ static void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi) | |||
3084 | s32 a1, b0, b1; | 3084 | s32 a1, b0, b1; |
3085 | s32 tssi, pwr, maxtargetpwr, mintargetpwr; | 3085 | s32 tssi, pwr, maxtargetpwr, mintargetpwr; |
3086 | bool suspend; | 3086 | bool suspend; |
3087 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 3087 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
3088 | 3088 | ||
3089 | suspend = (0 == (bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & | 3089 | suspend = (0 == (bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) & |
3090 | MCTL_EN_MAC)); | 3090 | MCTL_EN_MAC)); |
@@ -4348,7 +4348,7 @@ void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi) | |||
4348 | { | 4348 | { |
4349 | s8 index; | 4349 | s8 index; |
4350 | u16 index2; | 4350 | u16 index2; |
4351 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 4351 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
4352 | struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; | 4352 | struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; |
4353 | u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi); | 4353 | u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi); |
4354 | if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) && | 4354 | if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) && |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c index 93869e89aa3d..084f18f4f950 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | |||
@@ -14121,7 +14121,7 @@ static u8 ant_sw_ctrl_tbl_rev8_2057v7_core1[] = { | |||
14121 | 14121 | ||
14122 | bool wlc_phy_bist_check_phy(struct brcms_phy_pub *pih) | 14122 | bool wlc_phy_bist_check_phy(struct brcms_phy_pub *pih) |
14123 | { | 14123 | { |
14124 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 14124 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
14125 | u32 phybist0, phybist1, phybist2, phybist3, phybist4; | 14125 | u32 phybist0, phybist1, phybist2, phybist3, phybist4; |
14126 | 14126 | ||
14127 | if (NREV_GE(pi->pubpi.phy_rev, 16)) | 14127 | if (NREV_GE(pi->pubpi.phy_rev, 16)) |
@@ -19734,7 +19734,7 @@ void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask) | |||
19734 | u16 regval; | 19734 | u16 regval; |
19735 | u16 tbl_buf[16]; | 19735 | u16 tbl_buf[16]; |
19736 | uint i; | 19736 | uint i; |
19737 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 19737 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
19738 | u16 tbl_opcode; | 19738 | u16 tbl_opcode; |
19739 | bool suspend; | 19739 | bool suspend; |
19740 | 19740 | ||
@@ -19812,7 +19812,7 @@ void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask) | |||
19812 | u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih) | 19812 | u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih) |
19813 | { | 19813 | { |
19814 | u16 regval, rxen_bits; | 19814 | u16 regval, rxen_bits; |
19815 | struct brcms_phy *pi = (struct brcms_phy *) pih; | 19815 | struct brcms_phy *pi = container_of(pih, struct brcms_phy, pubpi_ro); |
19816 | 19816 | ||
19817 | regval = read_phy_reg(pi, 0xa2); | 19817 | regval = read_phy_reg(pi, 0xa2); |
19818 | rxen_bits = (regval >> 4) & 0xf; | 19818 | rxen_bits = (regval >> 4) & 0xf; |
@@ -21342,7 +21342,7 @@ void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec) | |||
21342 | 21342 | ||
21343 | void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init) | 21343 | void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init) |
21344 | { | 21344 | { |
21345 | struct brcms_phy *pi = (struct brcms_phy *) ppi; | 21345 | struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); |
21346 | u16 mask = 0xfc00; | 21346 | u16 mask = 0xfc00; |
21347 | u32 mc = 0; | 21347 | u32 mc = 0; |
21348 | 21348 | ||