diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2014-08-23 09:42:15 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-28 14:49:38 -0400 |
commit | 11e39a4e054cde1aaa9f5d3830f41f86818602fd (patch) | |
tree | baa3e929aa75814e2bdc0518e812cab5885dde76 /drivers/net/wireless/ath/ath9k/beacon.c | |
parent | 7d876174e7cd81912930cb5e501f5036eabfaaf3 (diff) |
ath9k: Move ath9k_beacon_add_noa to channel.c
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/beacon.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index dc68d114f2fd..b2f56d8b9043 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -108,55 +108,6 @@ static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif, | |||
108 | ath9k_hw_set_txdesc(ah, bf->bf_desc, &info); | 108 | ath9k_hw_set_txdesc(ah, bf->bf_desc, &info); |
109 | } | 109 | } |
110 | 110 | ||
111 | static void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp, | ||
112 | struct sk_buff *skb) | ||
113 | { | ||
114 | static const u8 noa_ie_hdr[] = { | ||
115 | WLAN_EID_VENDOR_SPECIFIC, /* type */ | ||
116 | 0, /* length */ | ||
117 | 0x50, 0x6f, 0x9a, /* WFA OUI */ | ||
118 | 0x09, /* P2P subtype */ | ||
119 | 0x0c, /* Notice of Absence */ | ||
120 | 0x00, /* LSB of little-endian len */ | ||
121 | 0x00, /* MSB of little-endian len */ | ||
122 | }; | ||
123 | |||
124 | struct ieee80211_p2p_noa_attr *noa; | ||
125 | int noa_len, noa_desc, i = 0; | ||
126 | u8 *hdr; | ||
127 | |||
128 | if (!avp->offchannel_duration && !avp->periodic_noa_duration) | ||
129 | return; | ||
130 | |||
131 | noa_desc = !!avp->offchannel_duration + !!avp->periodic_noa_duration; | ||
132 | noa_len = 2 + sizeof(struct ieee80211_p2p_noa_desc) * noa_desc; | ||
133 | |||
134 | hdr = skb_put(skb, sizeof(noa_ie_hdr)); | ||
135 | memcpy(hdr, noa_ie_hdr, sizeof(noa_ie_hdr)); | ||
136 | hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2; | ||
137 | hdr[7] = noa_len; | ||
138 | |||
139 | noa = (void *) skb_put(skb, noa_len); | ||
140 | memset(noa, 0, noa_len); | ||
141 | |||
142 | noa->index = avp->noa_index; | ||
143 | if (avp->periodic_noa_duration) { | ||
144 | u32 interval = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval); | ||
145 | |||
146 | noa->desc[i].count = 255; | ||
147 | noa->desc[i].start_time = cpu_to_le32(avp->periodic_noa_start); | ||
148 | noa->desc[i].duration = cpu_to_le32(avp->periodic_noa_duration); | ||
149 | noa->desc[i].interval = cpu_to_le32(interval); | ||
150 | i++; | ||
151 | } | ||
152 | |||
153 | if (avp->offchannel_duration) { | ||
154 | noa->desc[i].count = 1; | ||
155 | noa->desc[i].start_time = cpu_to_le32(avp->offchannel_start); | ||
156 | noa->desc[i].duration = cpu_to_le32(avp->offchannel_duration); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw, | 111 | static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw, |
161 | struct ieee80211_vif *vif) | 112 | struct ieee80211_vif *vif) |
162 | { | 113 | { |