diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-27 12:13:43 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-27 13:07:50 -0400 |
commit | be9d215fa9d13ecfe013a1b0d0f92f6d84a52c5c (patch) | |
tree | eff2fa64d91467503c5332280c5b2eac415d1f3d /net/mac802154/rx.c | |
parent | b89c33417ffcc816df5755aec375a16d2657e4d3 (diff) |
mac802154: rx: change naming convention
This patch changes the naming convention of mac802154 rx file. It should
be more named like mac80211 stack. Furthermore we introduce a new frame
parsing implementation which is much similar the mac80211
implementation.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/rx.c')
-rw-r--r-- | net/mac802154/rx.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index 689bb7ff5b2a..86394befbf88 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include "ieee802154_i.h" | 30 | #include "ieee802154_i.h" |
31 | 31 | ||
32 | static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb) | 32 | static int ieee802154_deliver_skb(struct net_device *dev, struct sk_buff *skb) |
33 | { | 33 | { |
34 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 34 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
35 | skb->protocol = htons(ETH_P_IEEE802154); | 35 | skb->protocol = htons(ETH_P_IEEE802154); |
@@ -38,8 +38,8 @@ static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb) | |||
38 | } | 38 | } |
39 | 39 | ||
40 | static int | 40 | static int |
41 | mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb, | 41 | ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata, |
42 | const struct ieee802154_hdr *hdr) | 42 | struct sk_buff *skb, const struct ieee802154_hdr *hdr) |
43 | { | 43 | { |
44 | __le16 span, sshort; | 44 | __le16 span, sshort; |
45 | int rc; | 45 | int rc; |
@@ -103,7 +103,7 @@ mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb, | |||
103 | 103 | ||
104 | switch (mac_cb(skb)->type) { | 104 | switch (mac_cb(skb)->type) { |
105 | case IEEE802154_FC_TYPE_DATA: | 105 | case IEEE802154_FC_TYPE_DATA: |
106 | return mac802154_process_data(sdata->dev, skb); | 106 | return ieee802154_deliver_skb(sdata->dev, skb); |
107 | default: | 107 | default: |
108 | pr_warn("ieee802154: bad frame received (type = %d)\n", | 108 | pr_warn("ieee802154: bad frame received (type = %d)\n", |
109 | mac_cb(skb)->type); | 109 | mac_cb(skb)->type); |
@@ -115,8 +115,8 @@ fail: | |||
115 | return NET_RX_DROP; | 115 | return NET_RX_DROP; |
116 | } | 116 | } |
117 | 117 | ||
118 | static void mac802154_print_addr(const char *name, | 118 | static void |
119 | const struct ieee802154_addr *addr) | 119 | ieee802154_print_addr(const char *name, const struct ieee802154_addr *addr) |
120 | { | 120 | { |
121 | if (addr->mode == IEEE802154_ADDR_NONE) | 121 | if (addr->mode == IEEE802154_ADDR_NONE) |
122 | pr_debug("%s not present\n", name); | 122 | pr_debug("%s not present\n", name); |
@@ -132,8 +132,8 @@ static void mac802154_print_addr(const char *name, | |||
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | static int mac802154_parse_frame_start(struct sk_buff *skb, | 135 | static int |
136 | struct ieee802154_hdr *hdr) | 136 | ieee802154_parse_frame_start(struct sk_buff *skb, struct ieee802154_hdr *hdr) |
137 | { | 137 | { |
138 | int hlen; | 138 | int hlen; |
139 | struct ieee802154_mac_cb *cb = mac_cb_init(skb); | 139 | struct ieee802154_mac_cb *cb = mac_cb_init(skb); |
@@ -153,8 +153,8 @@ static int mac802154_parse_frame_start(struct sk_buff *skb, | |||
153 | cb->ackreq = hdr->fc.ack_request; | 153 | cb->ackreq = hdr->fc.ack_request; |
154 | cb->secen = hdr->fc.security_enabled; | 154 | cb->secen = hdr->fc.security_enabled; |
155 | 155 | ||
156 | mac802154_print_addr("destination", &hdr->dest); | 156 | ieee802154_print_addr("destination", &hdr->dest); |
157 | mac802154_print_addr("source", &hdr->source); | 157 | ieee802154_print_addr("source", &hdr->source); |
158 | 158 | ||
159 | cb->source = hdr->source; | 159 | cb->source = hdr->source; |
160 | cb->dest = hdr->dest; | 160 | cb->dest = hdr->dest; |
@@ -192,13 +192,14 @@ static int mac802154_parse_frame_start(struct sk_buff *skb, | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static void | 194 | static void |
195 | mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | 195 | __ieee802154_rx_handle_packet(struct ieee802154_local *local, |
196 | struct sk_buff *skb) | ||
196 | { | 197 | { |
197 | int ret; | 198 | int ret; |
198 | struct ieee802154_sub_if_data *sdata; | 199 | struct ieee802154_sub_if_data *sdata; |
199 | struct ieee802154_hdr hdr; | 200 | struct ieee802154_hdr hdr; |
200 | 201 | ||
201 | ret = mac802154_parse_frame_start(skb, &hdr); | 202 | ret = ieee802154_parse_frame_start(skb, &hdr); |
202 | if (ret) { | 203 | if (ret) { |
203 | pr_debug("got invalid frame\n"); | 204 | pr_debug("got invalid frame\n"); |
204 | kfree_skb(skb); | 205 | kfree_skb(skb); |
@@ -210,7 +211,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
210 | !netif_running(sdata->dev)) | 211 | !netif_running(sdata->dev)) |
211 | continue; | 212 | continue; |
212 | 213 | ||
213 | mac802154_subif_frame(sdata, skb, &hdr); | 214 | ieee802154_subif_frame(sdata, skb, &hdr); |
214 | skb = NULL; | 215 | skb = NULL; |
215 | break; | 216 | break; |
216 | } | 217 | } |
@@ -220,7 +221,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
220 | } | 221 | } |
221 | 222 | ||
222 | static void | 223 | static void |
223 | mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) | 224 | ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) |
224 | { | 225 | { |
225 | struct sk_buff *skb2; | 226 | struct sk_buff *skb2; |
226 | struct ieee802154_sub_if_data *sdata; | 227 | struct ieee802154_sub_if_data *sdata; |
@@ -271,8 +272,8 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) | |||
271 | 272 | ||
272 | rcu_read_lock(); | 273 | rcu_read_lock(); |
273 | 274 | ||
274 | mac802154_monitors_rx(local, skb); | 275 | ieee802154_monitors_rx(local, skb); |
275 | mac802154_wpans_rx(local, skb); | 276 | __ieee802154_rx_handle_packet(local, skb); |
276 | 277 | ||
277 | rcu_read_unlock(); | 278 | rcu_read_unlock(); |
278 | 279 | ||