Commit be9d215f authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

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: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent b89c3341
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "ieee802154_i.h" #include "ieee802154_i.h"
static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb) static int ieee802154_deliver_skb(struct net_device *dev, struct sk_buff *skb)
{ {
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->protocol = htons(ETH_P_IEEE802154); skb->protocol = htons(ETH_P_IEEE802154);
...@@ -38,8 +38,8 @@ static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb) ...@@ -38,8 +38,8 @@ static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb)
} }
static int static int
mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb, ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
const struct ieee802154_hdr *hdr) struct sk_buff *skb, const struct ieee802154_hdr *hdr)
{ {
__le16 span, sshort; __le16 span, sshort;
int rc; int rc;
...@@ -103,7 +103,7 @@ mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb, ...@@ -103,7 +103,7 @@ mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb,
switch (mac_cb(skb)->type) { switch (mac_cb(skb)->type) {
case IEEE802154_FC_TYPE_DATA: case IEEE802154_FC_TYPE_DATA:
return mac802154_process_data(sdata->dev, skb); return ieee802154_deliver_skb(sdata->dev, skb);
default: default:
pr_warn("ieee802154: bad frame received (type = %d)\n", pr_warn("ieee802154: bad frame received (type = %d)\n",
mac_cb(skb)->type); mac_cb(skb)->type);
...@@ -115,8 +115,8 @@ mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb, ...@@ -115,8 +115,8 @@ mac802154_subif_frame(struct ieee802154_sub_if_data *sdata, struct sk_buff *skb,
return NET_RX_DROP; return NET_RX_DROP;
} }
static void mac802154_print_addr(const char *name, static void
const struct ieee802154_addr *addr) ieee802154_print_addr(const char *name, const struct ieee802154_addr *addr)
{ {
if (addr->mode == IEEE802154_ADDR_NONE) if (addr->mode == IEEE802154_ADDR_NONE)
pr_debug("%s not present\n", name); pr_debug("%s not present\n", name);
...@@ -132,8 +132,8 @@ static void mac802154_print_addr(const char *name, ...@@ -132,8 +132,8 @@ static void mac802154_print_addr(const char *name,
} }
} }
static int mac802154_parse_frame_start(struct sk_buff *skb, static int
struct ieee802154_hdr *hdr) ieee802154_parse_frame_start(struct sk_buff *skb, struct ieee802154_hdr *hdr)
{ {
int hlen; int hlen;
struct ieee802154_mac_cb *cb = mac_cb_init(skb); struct ieee802154_mac_cb *cb = mac_cb_init(skb);
...@@ -153,8 +153,8 @@ static int mac802154_parse_frame_start(struct sk_buff *skb, ...@@ -153,8 +153,8 @@ static int mac802154_parse_frame_start(struct sk_buff *skb,
cb->ackreq = hdr->fc.ack_request; cb->ackreq = hdr->fc.ack_request;
cb->secen = hdr->fc.security_enabled; cb->secen = hdr->fc.security_enabled;
mac802154_print_addr("destination", &hdr->dest); ieee802154_print_addr("destination", &hdr->dest);
mac802154_print_addr("source", &hdr->source); ieee802154_print_addr("source", &hdr->source);
cb->source = hdr->source; cb->source = hdr->source;
cb->dest = hdr->dest; cb->dest = hdr->dest;
...@@ -192,13 +192,14 @@ static int mac802154_parse_frame_start(struct sk_buff *skb, ...@@ -192,13 +192,14 @@ static int mac802154_parse_frame_start(struct sk_buff *skb,
} }
static void static void
mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) __ieee802154_rx_handle_packet(struct ieee802154_local *local,
struct sk_buff *skb)
{ {
int ret; int ret;
struct ieee802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
struct ieee802154_hdr hdr; struct ieee802154_hdr hdr;
ret = mac802154_parse_frame_start(skb, &hdr); ret = ieee802154_parse_frame_start(skb, &hdr);
if (ret) { if (ret) {
pr_debug("got invalid frame\n"); pr_debug("got invalid frame\n");
kfree_skb(skb); kfree_skb(skb);
...@@ -210,7 +211,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -210,7 +211,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb)
!netif_running(sdata->dev)) !netif_running(sdata->dev))
continue; continue;
mac802154_subif_frame(sdata, skb, &hdr); ieee802154_subif_frame(sdata, skb, &hdr);
skb = NULL; skb = NULL;
break; break;
} }
...@@ -220,7 +221,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -220,7 +221,7 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb)
} }
static void static void
mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
{ {
struct sk_buff *skb2; struct sk_buff *skb2;
struct ieee802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
...@@ -271,8 +272,8 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) ...@@ -271,8 +272,8 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb)
rcu_read_lock(); rcu_read_lock();
mac802154_monitors_rx(local, skb); ieee802154_monitors_rx(local, skb);
mac802154_wpans_rx(local, skb); __ieee802154_rx_handle_packet(local, skb);
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment