diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-09 09:07:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-11 15:53:39 -0400 |
commit | e50db65c0dad109aae77c353305853b31555b228 (patch) | |
tree | 1c7f765e172092e2d6d0e63a1faa13c004f79c7a /net | |
parent | 759ef3eb1eeba8ff7411771e7b9cf6bfd6bb9cfe (diff) |
mac80211: move frame TX function
The ieee80211_sta_tx function isn't MLME code any more,
it's getting used by a lot of code. Move it to utils and
rename it to ieee80211_tx_skb.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ht.c | 8 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 4 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 4 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 24 | ||||
-rw-r--r-- | net/mac80211/scan.c | 2 | ||||
-rw-r--r-- | net/mac80211/spectmgmt.c | 2 | ||||
-rw-r--r-- | net/mac80211/util.c | 14 |
8 files changed, 30 insertions, 30 deletions
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 7e93e1079ade..4dc35c9dabc7 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c | |||
@@ -113,7 +113,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, | |||
113 | mgmt->u.action.u.addba_req.start_seq_num = | 113 | mgmt->u.action.u.addba_req.start_seq_num = |
114 | cpu_to_le16(start_seq_num << 4); | 114 | cpu_to_le16(start_seq_num << 4); |
115 | 115 | ||
116 | ieee80211_sta_tx(sdata, skb, 0); | 116 | ieee80211_tx_skb(sdata, skb, 0); |
117 | } | 117 | } |
118 | 118 | ||
119 | static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *da, u16 tid, | 119 | static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *da, u16 tid, |
@@ -159,7 +159,7 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d | |||
159 | mgmt->u.action.u.addba_resp.timeout = cpu_to_le16(timeout); | 159 | mgmt->u.action.u.addba_resp.timeout = cpu_to_le16(timeout); |
160 | mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); | 160 | mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); |
161 | 161 | ||
162 | ieee80211_sta_tx(sdata, skb, 0); | 162 | ieee80211_tx_skb(sdata, skb, 0); |
163 | } | 163 | } |
164 | 164 | ||
165 | static void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, | 165 | static void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, |
@@ -202,7 +202,7 @@ static void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, | |||
202 | mgmt->u.action.u.delba.params = cpu_to_le16(params); | 202 | mgmt->u.action.u.delba.params = cpu_to_le16(params); |
203 | mgmt->u.action.u.delba.reason_code = cpu_to_le16(reason_code); | 203 | mgmt->u.action.u.delba.reason_code = cpu_to_le16(reason_code); |
204 | 204 | ||
205 | ieee80211_sta_tx(sdata, skb, 0); | 205 | ieee80211_tx_skb(sdata, skb, 0); |
206 | } | 206 | } |
207 | 207 | ||
208 | void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn) | 208 | void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn) |
@@ -231,7 +231,7 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1 | |||
231 | bar->control = cpu_to_le16(bar_control); | 231 | bar->control = cpu_to_le16(bar_control); |
232 | bar->start_seq_num = cpu_to_le16(ssn); | 232 | bar->start_seq_num = cpu_to_le16(ssn); |
233 | 233 | ||
234 | ieee80211_sta_tx(sdata, skb, 0); | 234 | ieee80211_tx_skb(sdata, skb, 0); |
235 | } | 235 | } |
236 | 236 | ||
237 | void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, | 237 | void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index b2ca9e6122c6..6f334e4c3d66 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -912,8 +912,6 @@ u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); | |||
912 | u64 ieee80211_sta_get_rates(struct ieee80211_local *local, | 912 | u64 ieee80211_sta_get_rates(struct ieee80211_local *local, |
913 | struct ieee802_11_elems *elems, | 913 | struct ieee802_11_elems *elems, |
914 | enum ieee80211_band band); | 914 | enum ieee80211_band band); |
915 | void ieee80211_sta_tx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
916 | int encrypt); | ||
917 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | 915 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, |
918 | u8 *ssid, size_t ssid_len); | 916 | u8 *ssid, size_t ssid_len); |
919 | void ieee802_11_parse_elems(u8 *start, size_t len, | 917 | void ieee802_11_parse_elems(u8 *start, size_t len, |
@@ -1000,6 +998,8 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, | |||
1000 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 998 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
1001 | struct ieee80211_hdr *hdr); | 999 | struct ieee80211_hdr *hdr); |
1002 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); | 1000 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); |
1001 | void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
1002 | int encrypt); | ||
1003 | 1003 | ||
1004 | #ifdef CONFIG_MAC80211_NOINLINE | 1004 | #ifdef CONFIG_MAC80211_NOINLINE |
1005 | #define debug_noinline noinline | 1005 | #define debug_noinline noinline |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 59fd7fe377e0..210d6b852406 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -149,7 +149,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, | |||
149 | pos += ETH_ALEN; | 149 | pos += ETH_ALEN; |
150 | memcpy(pos, &dst_dsn, 4); | 150 | memcpy(pos, &dst_dsn, 4); |
151 | 151 | ||
152 | ieee80211_sta_tx(sdata, skb, 0); | 152 | ieee80211_tx_skb(sdata, skb, 0); |
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
155 | 155 | ||
@@ -198,7 +198,7 @@ int mesh_path_error_tx(u8 *dst, __le32 dst_dsn, u8 *ra, | |||
198 | pos += ETH_ALEN; | 198 | pos += ETH_ALEN; |
199 | memcpy(pos, &dst_dsn, 4); | 199 | memcpy(pos, &dst_dsn, 4); |
200 | 200 | ||
201 | ieee80211_sta_tx(sdata, skb, 0); | 201 | ieee80211_tx_skb(sdata, skb, 0); |
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 74983cfa7293..7356462dee96 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -217,7 +217,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
217 | memcpy(pos, &reason, 2); | 217 | memcpy(pos, &reason, 2); |
218 | } | 218 | } |
219 | 219 | ||
220 | ieee80211_sta_tx(sdata, skb, 0); | 220 | ieee80211_tx_skb(sdata, skb, 0); |
221 | return 0; | 221 | return 0; |
222 | } | 222 | } |
223 | 223 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f1ee9d22cf4b..2c06f6965b7d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -96,20 +96,6 @@ static int ieee80211_compatible_rates(struct ieee80211_sta_bss *bss, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | /* frame sending functions */ | 98 | /* frame sending functions */ |
99 | void ieee80211_sta_tx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
100 | int encrypt) | ||
101 | { | ||
102 | skb->dev = sdata->local->mdev; | ||
103 | skb_set_mac_header(skb, 0); | ||
104 | skb_set_network_header(skb, 0); | ||
105 | skb_set_transport_header(skb, 0); | ||
106 | |||
107 | skb->iif = sdata->dev->ifindex; | ||
108 | skb->do_not_encrypt = !encrypt; | ||
109 | |||
110 | dev_queue_xmit(skb); | ||
111 | } | ||
112 | |||
113 | static void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, | 99 | static void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, |
114 | struct ieee80211_if_sta *ifsta, | 100 | struct ieee80211_if_sta *ifsta, |
115 | int transaction, u8 *extra, size_t extra_len, | 101 | int transaction, u8 *extra, size_t extra_len, |
@@ -144,7 +130,7 @@ static void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, | |||
144 | if (extra) | 130 | if (extra) |
145 | memcpy(skb_put(skb, extra_len), extra, extra_len); | 131 | memcpy(skb_put(skb, extra_len), extra, extra_len); |
146 | 132 | ||
147 | ieee80211_sta_tx(sdata, skb, encrypt); | 133 | ieee80211_tx_skb(sdata, skb, encrypt); |
148 | } | 134 | } |
149 | 135 | ||
150 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | 136 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, |
@@ -204,7 +190,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | |||
204 | *pos = rate->bitrate / 5; | 190 | *pos = rate->bitrate / 5; |
205 | } | 191 | } |
206 | 192 | ||
207 | ieee80211_sta_tx(sdata, skb, 0); | 193 | ieee80211_tx_skb(sdata, skb, 0); |
208 | } | 194 | } |
209 | 195 | ||
210 | static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | 196 | static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, |
@@ -412,7 +398,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
412 | if (ifsta->assocreq_ies) | 398 | if (ifsta->assocreq_ies) |
413 | memcpy(ifsta->assocreq_ies, ies, ifsta->assocreq_ies_len); | 399 | memcpy(ifsta->assocreq_ies, ies, ifsta->assocreq_ies_len); |
414 | 400 | ||
415 | ieee80211_sta_tx(sdata, skb, 0); | 401 | ieee80211_tx_skb(sdata, skb, 0); |
416 | } | 402 | } |
417 | 403 | ||
418 | 404 | ||
@@ -442,7 +428,7 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, | |||
442 | /* u.deauth.reason_code == u.disassoc.reason_code */ | 428 | /* u.deauth.reason_code == u.disassoc.reason_code */ |
443 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); | 429 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); |
444 | 430 | ||
445 | ieee80211_sta_tx(sdata, skb, 0); | 431 | ieee80211_tx_skb(sdata, skb, 0); |
446 | } | 432 | } |
447 | 433 | ||
448 | /* MLME */ | 434 | /* MLME */ |
@@ -1796,7 +1782,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, | |||
1796 | printk(KERN_DEBUG "%s: Sending ProbeResp to %s\n", | 1782 | printk(KERN_DEBUG "%s: Sending ProbeResp to %s\n", |
1797 | sdata->dev->name, print_mac(mac, resp->da)); | 1783 | sdata->dev->name, print_mac(mac, resp->da)); |
1798 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 1784 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
1799 | ieee80211_sta_tx(sdata, skb, 0); | 1785 | ieee80211_tx_skb(sdata, skb, 0); |
1800 | } | 1786 | } |
1801 | 1787 | ||
1802 | static void ieee80211_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, | 1788 | static void ieee80211_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 9f6120150120..010781b806f3 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -421,7 +421,7 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
421 | memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN); | 421 | memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN); |
422 | memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN); | 422 | memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN); |
423 | 423 | ||
424 | ieee80211_sta_tx(sdata, skb, 0); | 424 | ieee80211_tx_skb(sdata, skb, 0); |
425 | } | 425 | } |
426 | 426 | ||
427 | static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | 427 | static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) |
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c index b7129f4ae0c3..f72bad636d8e 100644 --- a/net/mac80211/spectmgmt.c +++ b/net/mac80211/spectmgmt.c | |||
@@ -65,7 +65,7 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da | |||
65 | IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED; | 65 | IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED; |
66 | msr_report->u.action.u.measurement.msr_elem.type = request_ie->type; | 66 | msr_report->u.action.u.measurement.msr_elem.type = request_ie->type; |
67 | 67 | ||
68 | ieee80211_sta_tx(sdata, skb, 0); | 68 | ieee80211_tx_skb(sdata, skb, 0); |
69 | } | 69 | } |
70 | 70 | ||
71 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, | 71 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 55be3ef5c755..c3a22ab2ad2e 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -598,3 +598,17 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata) | |||
598 | for (i = 0; i < local_to_hw(local)->queues; i++) | 598 | for (i = 0; i < local_to_hw(local)->queues; i++) |
599 | local->ops->conf_tx(local_to_hw(local), i, &qparam); | 599 | local->ops->conf_tx(local_to_hw(local), i, &qparam); |
600 | } | 600 | } |
601 | |||
602 | void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
603 | int encrypt) | ||
604 | { | ||
605 | skb->dev = sdata->local->mdev; | ||
606 | skb_set_mac_header(skb, 0); | ||
607 | skb_set_network_header(skb, 0); | ||
608 | skb_set_transport_header(skb, 0); | ||
609 | |||
610 | skb->iif = sdata->dev->ifindex; | ||
611 | skb->do_not_encrypt = !encrypt; | ||
612 | |||
613 | dev_queue_xmit(skb); | ||
614 | } | ||