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