1
2
3
4
5#ifndef WL_CFGP2P_H_
6#define WL_CFGP2P_H_
7
8#include <net/cfg80211.h>
9
10struct brcmf_cfg80211_info;
11
12
13
14
15
16
17
18
19
20
21enum p2p_bss_type {
22 P2PAPI_BSSCFG_PRIMARY,
23 P2PAPI_BSSCFG_DEVICE,
24 P2PAPI_BSSCFG_CONNECTION,
25 P2PAPI_BSSCFG_CONNECTION2,
26 P2PAPI_BSSCFG_MAX
27};
28
29
30
31
32
33
34
35struct p2p_bss {
36 struct brcmf_cfg80211_vif *vif;
37 void *private_data;
38};
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57enum brcmf_p2p_status {
58 BRCMF_P2P_STATUS_ENABLED,
59 BRCMF_P2P_STATUS_IF_ADD,
60 BRCMF_P2P_STATUS_IF_DEL,
61 BRCMF_P2P_STATUS_IF_DELETING,
62 BRCMF_P2P_STATUS_IF_CHANGING,
63 BRCMF_P2P_STATUS_IF_CHANGED,
64 BRCMF_P2P_STATUS_ACTION_TX_COMPLETED,
65 BRCMF_P2P_STATUS_ACTION_TX_NOACK,
66 BRCMF_P2P_STATUS_GO_NEG_PHASE,
67 BRCMF_P2P_STATUS_DISCOVER_LISTEN,
68 BRCMF_P2P_STATUS_SENDING_ACT_FRAME,
69 BRCMF_P2P_STATUS_WAITING_NEXT_AF_LISTEN,
70 BRCMF_P2P_STATUS_WAITING_NEXT_ACT_FRAME,
71 BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL
72};
73
74
75
76
77
78
79
80
81
82
83
84
85
86struct afx_hdl {
87 struct work_struct afx_work;
88 struct completion act_frm_scan;
89 bool is_active;
90 s32 peer_chan;
91 bool is_listen;
92 u16 my_listen_chan;
93 u16 peer_listen_chan;
94 u8 tx_dst_addr[ETH_ALEN];
95};
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120struct brcmf_p2p_info {
121 struct brcmf_cfg80211_info *cfg;
122 unsigned long status;
123 u8 dev_addr[ETH_ALEN];
124 u8 conn_int_addr[ETH_ALEN];
125 u8 conn2_int_addr[ETH_ALEN];
126 struct p2p_bss bss_idx[P2PAPI_BSSCFG_MAX];
127 struct timer_list listen_timer;
128 u8 listen_channel;
129 struct ieee80211_channel remain_on_channel;
130 u32 remain_on_channel_cookie;
131 u8 next_af_subtype;
132 struct completion send_af_done;
133 struct afx_hdl afx_hdl;
134 u32 af_sent_channel;
135 unsigned long af_tx_sent_jiffies;
136 struct completion wait_next_af;
137 bool gon_req_action;
138 bool block_gon_req_tx;
139 bool p2pdev_dynamically;
140 bool wait_for_offchan_complete;
141};
142
143s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced);
144void brcmf_p2p_detach(struct brcmf_p2p_info *p2p);
145struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
146 unsigned char name_assign_type,
147 enum nl80211_iftype type,
148 struct vif_params *params);
149int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
150int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
151 enum brcmf_fil_p2p_if_types if_type);
152void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked);
153int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev);
154void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev);
155int brcmf_p2p_scan_prep(struct wiphy *wiphy,
156 struct cfg80211_scan_request *request,
157 struct brcmf_cfg80211_vif *vif);
158int brcmf_p2p_remain_on_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
159 struct ieee80211_channel *channel,
160 unsigned int duration, u64 *cookie);
161int brcmf_p2p_notify_listen_complete(struct brcmf_if *ifp,
162 const struct brcmf_event_msg *e,
163 void *data);
164void brcmf_p2p_cancel_remain_on_channel(struct brcmf_if *ifp);
165int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
166 const struct brcmf_event_msg *e,
167 void *data);
168int brcmf_p2p_notify_action_tx_complete(struct brcmf_if *ifp,
169 const struct brcmf_event_msg *e,
170 void *data);
171bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
172 struct net_device *ndev,
173 struct brcmf_fil_af_params_le *af_params);
174bool brcmf_p2p_scan_finding_common_channel(struct brcmf_cfg80211_info *cfg,
175 struct brcmf_bss_info_le *bi);
176s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp,
177 const struct brcmf_event_msg *e,
178 void *data);
179#endif
180