aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-04-05 04:57:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-08 15:28:45 -0400
commitf96aa07ecc2412c8be3a5473d1e765f223c31fd8 (patch)
treeb6aa98616765dfff96bf9f54e5be85f1acad0221 /drivers/net/wireless
parent7fa2e3529c51f1c3590964c1746cc48d04cbc0ab (diff)
brcmfmac: use struct brcmf_if instance as parameter in brcmf_set_mpc()
Remove use of struct netdevice as parameter to brcmf_set_mpc() as it will not always be available, ie. there will be non-netdevice interfaces. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/p2p.c8
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c29
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h2
3 files changed, 20 insertions, 19 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 4166e642068b..454a8deb0f10 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -1384,7 +1384,7 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
1384 /* After complete GO Negotiation, roll back to mpc mode */ 1384 /* After complete GO Negotiation, roll back to mpc mode */
1385 if ((action == P2P_PAF_GON_CONF) || 1385 if ((action == P2P_PAF_GON_CONF) ||
1386 (action == P2P_PAF_PROVDIS_RSP)) 1386 (action == P2P_PAF_PROVDIS_RSP))
1387 brcmf_set_mpc(ifp->ndev, 1); 1387 brcmf_set_mpc(ifp, 1);
1388 if (action == P2P_PAF_GON_CONF) { 1388 if (action == P2P_PAF_GON_CONF) {
1389 brcmf_dbg(TRACE, "P2P: GO_NEG_PHASE status cleared\n"); 1389 brcmf_dbg(TRACE, "P2P: GO_NEG_PHASE status cleared\n");
1390 clear_bit(BRCMF_P2P_STATUS_GO_NEG_PHASE, &p2p->status); 1390 clear_bit(BRCMF_P2P_STATUS_GO_NEG_PHASE, &p2p->status);
@@ -1725,7 +1725,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
1725 1725
1726 /* To make sure to send successfully action frame, turn off mpc */ 1726 /* To make sure to send successfully action frame, turn off mpc */
1727 if (config_af_params.mpc_onoff == 0) 1727 if (config_af_params.mpc_onoff == 0)
1728 brcmf_set_mpc(ndev, 0); 1728 brcmf_set_mpc(netdev_priv(ndev), 0);
1729 1729
1730 /* set status and destination address before sending af */ 1730 /* set status and destination address before sending af */
1731 if (p2p->next_af_subtype != P2P_PAF_SUBTYPE_INVALID) { 1731 if (p2p->next_af_subtype != P2P_PAF_SUBTYPE_INVALID) {
@@ -1820,7 +1820,7 @@ exit:
1820 clear_bit(BRCMF_P2P_STATUS_WAITING_NEXT_ACT_FRAME, &p2p->status); 1820 clear_bit(BRCMF_P2P_STATUS_WAITING_NEXT_ACT_FRAME, &p2p->status);
1821 /* if all done, turn mpc on again */ 1821 /* if all done, turn mpc on again */
1822 if (config_af_params.mpc_onoff == 1) 1822 if (config_af_params.mpc_onoff == 1)
1823 brcmf_set_mpc(ndev, 1); 1823 brcmf_set_mpc(netdev_priv(ndev), 1);
1824 1824
1825 return ack; 1825 return ack;
1826} 1826}
@@ -2046,7 +2046,7 @@ int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
2046 brcmf_err("vif for P2PAPI_BSSCFG_CONNECTION does not exist\n"); 2046 brcmf_err("vif for P2PAPI_BSSCFG_CONNECTION does not exist\n");
2047 return -EPERM; 2047 return -EPERM;
2048 } 2048 }
2049 brcmf_set_mpc(vif->ifp->ndev, 0); 2049 brcmf_set_mpc(vif->ifp, 0);
2050 2050
2051 /* In concurrency case, STA may be already associated in a particular */ 2051 /* In concurrency case, STA may be already associated in a particular */
2052 /* channel. so retrieve the current channel of primary interface and */ 2052 /* channel. so retrieve the current channel of primary interface and */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 56359e3e7eb6..3b79f0c89c47 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -490,9 +490,8 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
490 } 490 }
491} 491}
492 492
493void brcmf_set_mpc(struct net_device *ndev, int mpc) 493void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
494{ 494{
495 struct brcmf_if *ifp = netdev_priv(ndev);
496 s32 err = 0; 495 s32 err = 0;
497 496
498 if (check_vif_up(ifp->vif)) { 497 if (check_vif_up(ifp->vif)) {
@@ -510,6 +509,7 @@ brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
510 struct net_device *ndev, 509 struct net_device *ndev,
511 bool aborted, bool fw_abort) 510 bool aborted, bool fw_abort)
512{ 511{
512 struct brcmf_if *ifp = netdev_priv(ndev);
513 struct brcmf_scan_params_le params_le; 513 struct brcmf_scan_params_le params_le;
514 struct cfg80211_scan_request *scan_request; 514 struct cfg80211_scan_request *scan_request;
515 s32 err = 0; 515 s32 err = 0;
@@ -539,7 +539,7 @@ brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
539 /* Scan is aborted by setting channel_list[0] to -1 */ 539 /* Scan is aborted by setting channel_list[0] to -1 */
540 params_le.channel_list[0] = cpu_to_le16(-1); 540 params_le.channel_list[0] = cpu_to_le16(-1);
541 /* E-Scan (or anyother type) can be aborted by SCAN */ 541 /* E-Scan (or anyother type) can be aborted by SCAN */
542 err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SCAN, 542 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
543 &params_le, sizeof(params_le)); 543 &params_le, sizeof(params_le));
544 if (err) 544 if (err)
545 brcmf_err("Scan abort failed\n"); 545 brcmf_err("Scan abort failed\n");
@@ -553,12 +553,12 @@ brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
553 cfg->sched_escan = false; 553 cfg->sched_escan = false;
554 if (!aborted) 554 if (!aborted)
555 cfg80211_sched_scan_results(cfg_to_wiphy(cfg)); 555 cfg80211_sched_scan_results(cfg_to_wiphy(cfg));
556 brcmf_set_mpc(ndev, 1); 556 brcmf_set_mpc(ifp, 1);
557 } else if (scan_request) { 557 } else if (scan_request) {
558 brcmf_dbg(SCAN, "ESCAN Completed scan: %s\n", 558 brcmf_dbg(SCAN, "ESCAN Completed scan: %s\n",
559 aborted ? "Aborted" : "Done"); 559 aborted ? "Aborted" : "Done");
560 cfg80211_scan_done(scan_request, aborted); 560 cfg80211_scan_done(scan_request, aborted);
561 brcmf_set_mpc(ndev, 1); 561 brcmf_set_mpc(ifp, 1);
562 } 562 }
563 if (!test_and_clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) 563 if (!test_and_clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status))
564 brcmf_dbg(SCAN, "Scan complete, probably P2P scan\n"); 564 brcmf_dbg(SCAN, "Scan complete, probably P2P scan\n");
@@ -813,19 +813,20 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy,
813 u32 passive_scan; 813 u32 passive_scan;
814 struct brcmf_scan_results *results; 814 struct brcmf_scan_results *results;
815 struct escan_info *escan = &cfg->escan_info; 815 struct escan_info *escan = &cfg->escan_info;
816 struct brcmf_if *ifp = netdev_priv(ndev);
816 817
817 brcmf_dbg(SCAN, "Enter\n"); 818 brcmf_dbg(SCAN, "Enter\n");
818 escan->ndev = ndev; 819 escan->ndev = ndev;
819 escan->wiphy = wiphy; 820 escan->wiphy = wiphy;
820 escan->escan_state = WL_ESCAN_STATE_SCANNING; 821 escan->escan_state = WL_ESCAN_STATE_SCANNING;
821 passive_scan = cfg->active_scan ? 0 : 1; 822 passive_scan = cfg->active_scan ? 0 : 1;
822 err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PASSIVE_SCAN, 823 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
823 passive_scan); 824 passive_scan);
824 if (err) { 825 if (err) {
825 brcmf_err("error (%d)\n", err); 826 brcmf_err("error (%d)\n", err);
826 return err; 827 return err;
827 } 828 }
828 brcmf_set_mpc(ndev, 0); 829 brcmf_set_mpc(ifp, 0);
829 results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf; 830 results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
830 results->version = 0; 831 results->version = 0;
831 results->count = 0; 832 results->count = 0;
@@ -833,7 +834,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy,
833 834
834 err = escan->run(cfg, ndev, request, WL_ESCAN_ACTION_START); 835 err = escan->run(cfg, ndev, request, WL_ESCAN_ACTION_START);
835 if (err) 836 if (err)
836 brcmf_set_mpc(ndev, 1); 837 brcmf_set_mpc(ifp, 1);
837 return err; 838 return err;
838} 839}
839 840
@@ -921,7 +922,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct net_device *ndev,
921 brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err); 922 brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
922 goto scan_out; 923 goto scan_out;
923 } 924 }
924 brcmf_set_mpc(ndev, 0); 925 brcmf_set_mpc(ifp, 0);
925 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN, 926 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
926 &sr->ssid_le, sizeof(sr->ssid_le)); 927 &sr->ssid_le, sizeof(sr->ssid_le));
927 if (err) { 928 if (err) {
@@ -931,7 +932,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct net_device *ndev,
931 else 932 else
932 brcmf_err("WLC_SCAN error (%d)\n", err); 933 brcmf_err("WLC_SCAN error (%d)\n", err);
933 934
934 brcmf_set_mpc(ndev, 1); 935 brcmf_set_mpc(ifp, 1);
935 goto scan_out; 936 goto scan_out;
936 } 937 }
937 } 938 }
@@ -2697,7 +2698,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
2697 brcmf_abort_scanning(cfg); 2698 brcmf_abort_scanning(cfg);
2698 2699
2699 /* Turn off watchdog timer */ 2700 /* Turn off watchdog timer */
2700 brcmf_set_mpc(ndev, 1); 2701 brcmf_set_mpc(netdev_priv(ndev), 1);
2701 2702
2702exit: 2703exit:
2703 brcmf_dbg(TRACE, "Exit\n"); 2704 brcmf_dbg(TRACE, "Exit\n");
@@ -3668,7 +3669,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
3668 ssid_le.SSID_len = cpu_to_le32((u32)settings->ssid_len); 3669 ssid_le.SSID_len = cpu_to_le32((u32)settings->ssid_len);
3669 } 3670 }
3670 3671
3671 brcmf_set_mpc(ndev, 0); 3672 brcmf_set_mpc(ifp, 0);
3672 3673
3673 /* find the RSN_IE */ 3674 /* find the RSN_IE */
3674 rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, 3675 rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
@@ -3776,7 +3777,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
3776 3777
3777exit: 3778exit:
3778 if (err) 3779 if (err)
3779 brcmf_set_mpc(ndev, 1); 3780 brcmf_set_mpc(ifp, 1);
3780 return err; 3781 return err;
3781} 3782}
3782 3783
@@ -3810,7 +3811,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
3810 if (err < 0) 3811 if (err < 0)
3811 brcmf_err("bss_enable config failed %d\n", err); 3812 brcmf_err("bss_enable config failed %d\n", err);
3812 } 3813 }
3813 brcmf_set_mpc(ndev, 1); 3814 brcmf_set_mpc(ifp, 1);
3814 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); 3815 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state);
3815 clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3816 clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
3816 3817
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
index 8b5d4989906c..cd4af981e224 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
@@ -495,7 +495,7 @@ int brcmf_cfg80211_wait_vif_event_timeout(struct brcmf_cfg80211_info *cfg,
495s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, 495s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
496 struct net_device *ndev, 496 struct net_device *ndev,
497 bool aborted, bool fw_abort); 497 bool aborted, bool fw_abort);
498void brcmf_set_mpc(struct net_device *ndev, int mpc); 498void brcmf_set_mpc(struct brcmf_if *ndev, int mpc);
499void brcmf_abort_scanning(struct brcmf_cfg80211_info *cfg); 499void brcmf_abort_scanning(struct brcmf_cfg80211_info *cfg);
500 500
501#endif /* _wl_cfg80211_h_ */ 501#endif /* _wl_cfg80211_h_ */