brcmfmac: P2P action frame tx.
[deliverable/linux.git] / drivers / net / wireless / brcm80211 / brcmfmac / p2p.h
1 /*
2 * Copyright (c) 2012 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16 #ifndef WL_CFGP2P_H_
17 #define WL_CFGP2P_H_
18
19 #include <net/cfg80211.h>
20
21 struct brcmf_cfg80211_info;
22
23 /* vendor ies max buffer length for probe response or beacon */
24 #define VNDR_IES_MAX_BUF_LEN 1400
25 /* normal vendor ies buffer length */
26 #define VNDR_IES_BUF_LEN 512
27
28 /* Structure to hold all saved P2P and WPS IEs for a BSSCFG */
29 /**
30 * enum p2p_bss_type - different type of BSS configurations.
31 *
32 * @P2PAPI_BSSCFG_PRIMARY: maps to driver's primary bsscfg.
33 * @P2PAPI_BSSCFG_DEVICE: maps to driver's P2P device discovery bsscfg.
34 * @P2PAPI_BSSCFG_CONNECTION: maps to driver's P2P connection bsscfg.
35 * @P2PAPI_BSSCFG_MAX: used for range checking.
36 */
37 enum p2p_bss_type {
38 P2PAPI_BSSCFG_PRIMARY, /* maps to driver's primary bsscfg */
39 P2PAPI_BSSCFG_DEVICE, /* maps to driver's P2P device discovery bsscfg */
40 P2PAPI_BSSCFG_CONNECTION, /* maps to driver's P2P connection bsscfg */
41 P2PAPI_BSSCFG_MAX
42 };
43
44 /**
45 * struct p2p_bss - peer-to-peer bss related information.
46 *
47 * @vif: virtual interface of this P2P bss.
48 * @private_data: TBD
49 */
50 struct p2p_bss {
51 struct brcmf_cfg80211_vif *vif;
52 void *private_data;
53 };
54
55 /**
56 * enum brcmf_p2p_status - P2P specific dongle status.
57 *
58 * @BRCMF_P2P_STATUS_IF_ADD: peer-to-peer vif add sent to dongle.
59 * @BRCMF_P2P_STATUS_IF_DEL: NOT-USED?
60 * @BRCMF_P2P_STATUS_IF_DELETING: peer-to-peer vif delete sent to dongle.
61 * @BRCMF_P2P_STATUS_IF_CHANGING: peer-to-peer vif change sent to dongle.
62 * @BRCMF_P2P_STATUS_IF_CHANGED: peer-to-peer vif change completed on dongle.
63 * @BRCMF_P2P_STATUS_ACTION_TX_COMPLETED: action frame tx completed.
64 * @BRCMF_P2P_STATUS_ACTION_TX_NOACK: action frame tx not acked.
65 * @BRCMF_P2P_STATUS_GO_NEG_PHASE: P2P GO negotiation ongoing.
66 * @BRCMF_P2P_STATUS_REMAIN_ON_CHANNEL: P2P listen, remaining on channel.
67 */
68 enum brcmf_p2p_status {
69 BRCMF_P2P_STATUS_IF_ADD = 0,
70 BRCMF_P2P_STATUS_IF_DEL,
71 BRCMF_P2P_STATUS_IF_DELETING,
72 BRCMF_P2P_STATUS_IF_CHANGING,
73 BRCMF_P2P_STATUS_IF_CHANGED,
74 BRCMF_P2P_STATUS_ACTION_TX_COMPLETED,
75 BRCMF_P2P_STATUS_ACTION_TX_NOACK,
76 BRCMF_P2P_STATUS_GO_NEG_PHASE,
77 BRCMF_P2P_STATUS_REMAIN_ON_CHANNEL
78 };
79
80 /**
81 * struct brcmf_p2p_info - p2p specific driver information.
82 *
83 * @cfg: driver private data for cfg80211 interface.
84 * @status: status of P2P (see enum brcmf_p2p_status).
85 * @dev_addr: P2P device address.
86 * @int_addr: P2P interface address.
87 * @bss_idx: informate for P2P bss types.
88 * @listen_timer: timer for @WL_P2P_DISC_ST_LISTEN discover state.
89 * @ssid: ssid for P2P GO.
90 * @listen_channel: channel for @WL_P2P_DISC_ST_LISTEN discover state.
91 * @remain_on_channel: contains copy of struct used by cfg80211.
92 * @next_af_subtype: expected action frame subtype.
93 * @send_af_done: indication that action frame tx is complete.
94 */
95 struct brcmf_p2p_info {
96 struct brcmf_cfg80211_info *cfg;
97 unsigned long status;
98 u8 dev_addr[ETH_ALEN];
99 u8 int_addr[ETH_ALEN];
100 struct p2p_bss bss_idx[P2PAPI_BSSCFG_MAX];
101 struct timer_list listen_timer;
102 struct brcmf_ssid ssid;
103 u8 listen_channel;
104 struct ieee80211_channel remain_on_channel;
105 u8 next_af_subtype;
106 struct completion send_af_done;
107 };
108
109 void brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg,
110 struct brcmf_cfg80211_vif *vif);
111 void brcmf_p2p_detach(struct brcmf_p2p_info *p2p);
112 struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
113 enum nl80211_iftype type, u32 *flags,
114 struct vif_params *params);
115 int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
116 int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
117 enum brcmf_fil_p2p_if_types if_type);
118 int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev);
119 void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev);
120 int brcmf_p2p_scan_prep(struct wiphy *wiphy,
121 struct cfg80211_scan_request *request,
122 struct brcmf_cfg80211_vif *vif);
123 int brcmf_p2p_remain_on_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
124 struct ieee80211_channel *channel,
125 unsigned int duration, u64 *cookie);
126 int brcmf_p2p_notify_listen_complete(struct brcmf_if *ifp,
127 const struct brcmf_event_msg *e,
128 void *data);
129 void brcmf_p2p_cancel_remain_on_channel(struct brcmf_if *ifp);
130 int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
131 const struct brcmf_event_msg *e,
132 void *data);
133 int brcmf_p2p_notify_action_tx_complete(struct brcmf_if *ifp,
134 const struct brcmf_event_msg *e,
135 void *data);
136 bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
137 struct net_device *ndev,
138 struct brcmf_fil_af_params_le *af_params);
139
140 #endif /* WL_CFGP2P_H_ */
This page took 0.035096 seconds and 5 git commands to generate.