This is a first pass, do you want to touch up the wpan ones?

Signed-off-by: Jon Smirl <[email protected]>
---
 net/mac802154/beacon.c      |   16 ++++---
 net/mac802154/beacon_hash.c |   12 +++--
 net/mac802154/beacon_hash.h |    8 ++--
 net/mac802154/mac802154.h   |   36 ++++++++--------
 net/mac802154/mac_cmd.c     |   94 ++++++++++++++++++++++---------------------
 net/mac802154/main.c        |   44 ++++++++++----------
 net/mac802154/mib.c         |   56 +++++++++++++-------------
 net/mac802154/mib.h         |   22 +++++-----
 net/mac802154/monitor.c     |   24 +++++------
 net/mac802154/rx.c          |   28 ++++++-------
 net/mac802154/scan.c        |   10 ++---
 net/mac802154/tx.c          |   10 ++---
 net/mac802154/wpan.c        |   74 +++++++++++++++++-----------------
 13 files changed, 217 insertions(+), 217 deletions(-)

diff --git a/net/mac802154/beacon.c b/net/mac802154/beacon.c
index 7bcba94..6b0d327 100644
--- a/net/mac802154/beacon.c
+++ b/net/mac802154/beacon.c
@@ -94,13 +94,13 @@
 #define IEEE802154_BEACON_FLAG_CANASSOC                (1 << 1)
 #define IEEE802154_BEACON_FLAG_GTSPERMIT               (1 << 2)
 
-struct ieee802154_address_list {
+struct mac802154_address_list {
        struct list_head list;
        struct ieee802154_addr addr;
 };
 
 /* Per spec; optimizations are needed */
-struct ieee802154_pandsc {
+struct mac802154_pandsc {
        struct list_head        list;
        struct ieee802154_addr  addr; /* Contains panid */
        int                     channel;
@@ -135,7 +135,7 @@ struct ieee802154_pandsc {
 */
 
 
-int ieee802154_send_beacon(struct net_device *dev,
+int mac802154_send_beacon(struct net_device *dev,
                struct ieee802154_addr *saddr,
                u16 pan_id, const u8 *buf, int len,
                int flags, struct list_head *al)
@@ -212,10 +212,10 @@ static int parse_beacon_frame(struct sk_buff *skb, u8 
*buf,
        int offt = 0;
        u8 gts_spec;
        u8 pa_spec;
-       struct ieee802154_pandsc *pd;
+       struct mac802154_pandsc *pd;
        u16 sf = skb->data[0] + (skb->data[1] << 8);
 
-       pd = kzalloc(sizeof(struct ieee802154_pandsc), GFP_KERNEL);
+       pd = kzalloc(sizeof(struct mac802154_pandsc), GFP_KERNEL);
 
        /* Filling-up pre-parsed values */
        pd->lqi = mac_cb(skb)->lqi;
@@ -257,7 +257,7 @@ static int parse_beacon_frame(struct sk_buff *skb, u8 *buf,
        return 0;
 }
 
-int ieee802154_process_beacon(struct net_device *dev,
+int mac802154_process_beacon(struct net_device *dev,
                struct sk_buff *skb)
 {
        int flags;
@@ -272,8 +272,8 @@ int ieee802154_process_beacon(struct net_device *dev,
        }
        dev_dbg(&dev->dev, "got beacon from pan %04x\n",
                        mac_cb(skb)->sa.pan_id);
-       ieee802154_beacon_hash_add(&mac_cb(skb)->sa);
-       ieee802154_beacon_hash_dump();
+       mac802154_beacon_hash_add(&mac_cb(skb)->sa);
+       mac802154_beacon_hash_dump();
        ret = NET_RX_SUCCESS;
 fail:
        kfree_skb(skb);
diff --git a/net/mac802154/beacon_hash.c b/net/mac802154/beacon_hash.c
index ba52bdf..97fb987 100644
--- a/net/mac802154/beacon_hash.c
+++ b/net/mac802154/beacon_hash.c
@@ -49,7 +49,7 @@ static void __beacon_add_node(struct ieee802154_addr 
*coord_addr, u16 pan_addr)
        hlist_add_head(&node->list, list);
 }
 
-struct beacon_node *ieee802154_beacon_find_pan(
+struct beacon_node *mac802154_beacon_find_pan(
                struct ieee802154_addr *coord_addr, u16 pan_addr)
 {
        struct hlist_head *list;
@@ -66,18 +66,18 @@ struct beacon_node *ieee802154_beacon_find_pan(
        return NULL;
 }
 
-void ieee802154_beacon_hash_add(struct ieee802154_addr *coord_addr)
+void mac802154_beacon_hash_add(struct ieee802154_addr *coord_addr)
 {
-       if (!ieee802154_beacon_find_pan(coord_addr, coord_addr->pan_id)) {
+       if (!mac802154_beacon_find_pan(coord_addr, coord_addr->pan_id)) {
                spin_lock(&beacon_hash_lock);
                __beacon_add_node(coord_addr, coord_addr->pan_id);
                spin_unlock(&beacon_hash_lock);
        }
 }
 
-void ieee802154_beacon_hash_del(struct ieee802154_addr *coord_addr)
+void mac802154_beacon_hash_del(struct ieee802154_addr *coord_addr)
 {
-       struct beacon_node *entry = ieee802154_beacon_find_pan(coord_addr,
+       struct beacon_node *entry = mac802154_beacon_find_pan(coord_addr,
                                                        coord_addr->pan_id);
        if (!entry)
                return;
@@ -87,7 +87,7 @@ void ieee802154_beacon_hash_del(struct ieee802154_addr 
*coord_addr)
        kfree(entry);
 }
 
-void ieee802154_beacon_hash_dump(void)
+void mac802154_beacon_hash_dump(void)
 {
        int i;
        struct hlist_node *tmp;
diff --git a/net/mac802154/beacon_hash.h b/net/mac802154/beacon_hash.h
index 17f7127..a732aa5 100644
--- a/net/mac802154/beacon_hash.h
+++ b/net/mac802154/beacon_hash.h
@@ -31,11 +31,11 @@ struct beacon_node {
        struct ieee802154_addr coord_addr;
        u16 pan_addr;
 };
-struct beacon_node *ieee802154_beacon_find_pan(
+struct beacon_node *mac802154_beacon_find_pan(
                struct ieee802154_addr *coord_addr,
                u16 pan_addr);
-void ieee802154_beacon_hash_add(struct ieee802154_addr *coord_addr);
-void ieee802154_beacon_hash_del(struct ieee802154_addr *coord_addr);
-void ieee802154_beacon_hash_dump(void);
+void mac802154_beacon_hash_add(struct ieee802154_addr *coord_addr);
+void mac802154_beacon_hash_del(struct ieee802154_addr *coord_addr);
+void mac802154_beacon_hash_dump(void);
 #endif
 
diff --git a/net/mac802154/mac802154.h b/net/mac802154/mac802154.h
index a784733..4944260 100644
--- a/net/mac802154/mac802154.h
+++ b/net/mac802154/mac802154.h
@@ -24,7 +24,7 @@
 
 #include <linux/spinlock.h>
 
-struct ieee802154_priv {
+struct mac802154_priv {
        struct ieee802154_dev   hw;
        struct ieee802154_ops   *ops;
 
@@ -45,9 +45,9 @@ struct ieee802154_priv {
        struct workqueue_struct *dev_workqueue;
 };
 
-#define ieee802154_to_priv(_hw)        container_of(_hw, struct 
ieee802154_priv, hw)
+#define mac802154_to_priv(_hw) container_of(_hw, struct mac802154_priv, hw)
 
-struct ieee802154_wpan_mib {
+struct mac802154_wpan_mib {
        spinlock_t mib_lock;
 
        u16 pan_id;
@@ -62,10 +62,10 @@ struct ieee802154_wpan_mib {
        u8 dsn;
 };
 
-struct ieee802154_sub_if_data {
+struct mac802154_sub_if_data {
        struct list_head list; /* the ieee802154_priv->slaves list */
 
-       struct ieee802154_priv *hw;
+       struct mac802154_priv *hw;
        struct net_device *dev;
 
        int type;
@@ -86,28 +86,28 @@ struct ieee802154_sub_if_data {
 
 extern struct ieee802154_mlme_ops mac802154_mlme;
 
-int ieee802154_mlme_scan_req(struct net_device *dev,
+int mac802154_mlme_scan_req(struct net_device *dev,
                u8 type, u32 channels, u8 page, u8 duration);
 
-int ieee802154_process_cmd(struct net_device *dev, struct sk_buff *skb);
-int ieee802154_process_beacon(struct net_device *dev, struct sk_buff *skb);
-int ieee802154_send_beacon(struct net_device *dev,
+int mac802154_process_cmd(struct net_device *dev, struct sk_buff *skb);
+int mac802154_process_beacon(struct net_device *dev, struct sk_buff *skb);
+int mac802154_send_beacon(struct net_device *dev,
                struct ieee802154_addr *saddr,
                u16 pan_id, const u8 *buf, int len,
                int flags, struct list_head *al);
-int ieee802154_send_beacon_req(struct net_device *dev);
+int mac802154_send_beacon_req(struct net_device *dev);
 
-struct ieee802154_priv *ieee802154_slave_get_priv(struct net_device *dev);
+struct mac802154_priv *mac802154_slave_get_priv(struct net_device *dev);
 
-void ieee802154_monitors_rx(struct ieee802154_priv *priv, struct sk_buff *skb);
-void ieee802154_monitor_setup(struct net_device *dev);
+void mac802154_monitors_rx(struct mac802154_priv *priv, struct sk_buff *skb);
+void mac802154_monitor_setup(struct net_device *dev);
 
-void ieee802154_wpans_rx(struct ieee802154_priv *priv, struct sk_buff *skb);
-void ieee802154_wpan_setup(struct net_device *dev);
+void mac802154_wpans_rx(struct mac802154_priv *priv, struct sk_buff *skb);
+void mac802154_wpan_setup(struct net_device *dev);
 
-int ieee802154_slave_open(struct net_device *dev);
-int ieee802154_slave_close(struct net_device *dev);
+int mac802154_slave_open(struct net_device *dev);
+int mac802154_slave_close(struct net_device *dev);
 
-netdev_tx_t ieee802154_tx(struct ieee802154_priv *priv, struct sk_buff *skb,
+netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
                u8 page, u8 chan);
 #endif
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index bf5ce0d..c41413a 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -33,7 +33,7 @@
 #include "mac802154.h"
 #include "mib.h"
 
-static int ieee802154_cmd_beacon_req(struct sk_buff *skb)
+static int mac802154_cmd_beacon_req(struct sk_buff *skb)
 {
        struct ieee802154_addr saddr; /* jeez */
        int flags = 0;
@@ -59,12 +59,12 @@ static int ieee802154_cmd_beacon_req(struct sk_buff *skb)
         * We have no information in this command to proceed with.
         * we need to submit beacon as answer to this. */
 
-       return ieee802154_send_beacon(skb->dev, &saddr,
+       return mac802154_send_beacon(skb->dev, &saddr,
                        ieee802154_mlme_ops(skb->dev)->get_pan_id(skb->dev),
                        NULL, 0, flags, NULL);
 }
 
-static int ieee802154_cmd_assoc_req(struct sk_buff *skb)
+static int mac802154_cmd_assoc_req(struct sk_buff *skb)
 {
        u8 cap;
 
@@ -88,7 +88,7 @@ static int ieee802154_cmd_assoc_req(struct sk_buff *skb)
        return ieee802154_nl_assoc_indic(skb->dev, &mac_cb(skb)->sa, cap);
 }
 
-static int ieee802154_cmd_assoc_resp(struct sk_buff *skb)
+static int mac802154_cmd_assoc_resp(struct sk_buff *skb)
 {
        u8 status;
        u16 short_addr;
@@ -111,17 +111,17 @@ static int ieee802154_cmd_assoc_resp(struct sk_buff *skb)
        pr_info("Received ASSOC-RESP status %x, addr %hx\n", status,
                        short_addr);
        if (status) {
-               ieee802154_dev_set_short_addr(skb->dev,
+               mac802154_dev_set_short_addr(skb->dev,
                                IEEE802154_ADDR_BROADCAST);
-               ieee802154_dev_set_pan_id(skb->dev,
+               mac802154_dev_set_pan_id(skb->dev,
                                IEEE802154_PANID_BROADCAST);
        } else
-               ieee802154_dev_set_short_addr(skb->dev, short_addr);
+               mac802154_dev_set_short_addr(skb->dev, short_addr);
 
        return ieee802154_nl_assoc_confirm(skb->dev, short_addr, status);
 }
 
-static int ieee802154_cmd_disassoc_notify(struct sk_buff *skb)
+static int mac802154_cmd_disassoc_notify(struct sk_buff *skb)
 {
        u8 reason;
 
@@ -147,7 +147,7 @@ static int ieee802154_cmd_disassoc_notify(struct sk_buff 
*skb)
                        reason);
 }
 
-int ieee802154_process_cmd(struct net_device *dev, struct sk_buff *skb)
+int mac802154_process_cmd(struct net_device *dev, struct sk_buff *skb)
 {
        u8 cmd;
 
@@ -161,16 +161,16 @@ int ieee802154_process_cmd(struct net_device *dev, struct 
sk_buff *skb)
 
        switch (cmd) {
        case IEEE802154_CMD_ASSOCIATION_REQ:
-               ieee802154_cmd_assoc_req(skb);
+               mac802154_cmd_assoc_req(skb);
                break;
        case IEEE802154_CMD_ASSOCIATION_RESP:
-               ieee802154_cmd_assoc_resp(skb);
+               mac802154_cmd_assoc_resp(skb);
                break;
        case IEEE802154_CMD_DISASSOCIATION_NOTIFY:
-               ieee802154_cmd_disassoc_notify(skb);
+               mac802154_cmd_disassoc_notify(skb);
                break;
        case IEEE802154_CMD_BEACON_REQ:
-               ieee802154_cmd_beacon_req(skb);
+               mac802154_cmd_beacon_req(skb);
                break;
        default:
                pr_debug("Frame type is not supported yet\n");
@@ -186,7 +186,7 @@ drop:
        return NET_RX_DROP;
 }
 
-static int ieee802154_send_cmd(struct net_device *dev,
+static int mac802154_send_cmd(struct net_device *dev,
                struct ieee802154_addr *addr, struct ieee802154_addr *saddr,
                const u8 *buf, int len)
 {
@@ -220,7 +220,7 @@ static int ieee802154_send_cmd(struct net_device *dev,
        return dev_queue_xmit(skb);
 }
 
-int ieee802154_send_beacon_req(struct net_device *dev)
+int mac802154_send_beacon_req(struct net_device *dev)
 {
        struct ieee802154_addr addr;
        struct ieee802154_addr saddr;
@@ -229,11 +229,11 @@ int ieee802154_send_beacon_req(struct net_device *dev)
        addr.short_addr = IEEE802154_ADDR_BROADCAST;
        addr.pan_id = IEEE802154_PANID_BROADCAST;
        saddr.addr_type = IEEE802154_ADDR_NONE;
-       return ieee802154_send_cmd(dev, &addr, &saddr, &cmd, 1);
+       return mac802154_send_cmd(dev, &addr, &saddr, &cmd, 1);
 }
 
 
-static int ieee802154_mlme_assoc_req(struct net_device *dev,
+static int mac802154_mlme_assoc_req(struct net_device *dev,
                struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap)
 {
        struct ieee802154_addr saddr;
@@ -246,18 +246,18 @@ static int ieee802154_mlme_assoc_req(struct net_device 
*dev,
 
 
        /* FIXME: set PIB/MIB info */
-       ieee802154_dev_set_pan_id(dev, addr->pan_id);
-       ieee802154_dev_set_page(dev, page);
-       ieee802154_dev_set_channel(dev, channel);
-       ieee802154_dev_set_ieee_addr(dev);
+       mac802154_dev_set_pan_id(dev, addr->pan_id);
+       mac802154_dev_set_page(dev, page);
+       mac802154_dev_set_channel(dev, channel);
+       mac802154_dev_set_ieee_addr(dev);
 
        buf[pos++] = IEEE802154_CMD_ASSOCIATION_REQ;
        buf[pos++] = cap;
 
-       return ieee802154_send_cmd(dev, addr, &saddr, buf, pos);
+       return mac802154_send_cmd(dev, addr, &saddr, buf, pos);
 }
 
-static int ieee802154_mlme_assoc_resp(struct net_device *dev,
+static int mac802154_mlme_assoc_resp(struct net_device *dev,
                struct ieee802154_addr *addr, u16 short_addr, u8 status)
 {
        struct ieee802154_addr saddr;
@@ -273,10 +273,10 @@ static int ieee802154_mlme_assoc_resp(struct net_device 
*dev,
        buf[pos++] = short_addr >> 8;
        buf[pos++] = status;
 
-       return ieee802154_send_cmd(dev, addr, &saddr, buf, pos);
+       return mac802154_send_cmd(dev, addr, &saddr, buf, pos);
 }
 
-static int ieee802154_mlme_disassoc_req(struct net_device *dev,
+static int mac802154_mlme_disassoc_req(struct net_device *dev,
                struct ieee802154_addr *addr, u8 reason)
 {
        struct ieee802154_addr saddr;
@@ -291,17 +291,17 @@ static int ieee802154_mlme_disassoc_req(struct net_device 
*dev,
        buf[pos++] = IEEE802154_CMD_DISASSOCIATION_NOTIFY;
        buf[pos++] = reason;
 
-       ret = ieee802154_send_cmd(dev, addr, &saddr, buf, pos);
+       ret = mac802154_send_cmd(dev, addr, &saddr, buf, pos);
 
        /* FIXME: this should be after the ack receved */
-       ieee802154_dev_set_pan_id(dev, 0xffff);
-       ieee802154_dev_set_short_addr(dev, 0xffff);
+       mac802154_dev_set_pan_id(dev, 0xffff);
+       mac802154_dev_set_short_addr(dev, 0xffff);
        ieee802154_nl_disassoc_confirm(dev, 0x00);
 
        return ret;
 }
 
-static int ieee802154_mlme_start_req(struct net_device *dev,
+static int mac802154_mlme_start_req(struct net_device *dev,
                                struct ieee802154_addr *addr,
                                u8 channel, u8 page,
                                u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
@@ -309,11 +309,11 @@ static int ieee802154_mlme_start_req(struct net_device 
*dev,
 {
        BUG_ON(addr->addr_type != IEEE802154_ADDR_SHORT);
 
-       ieee802154_dev_set_pan_id(dev, addr->pan_id);
-       ieee802154_dev_set_short_addr(dev, addr->short_addr);
-       ieee802154_dev_set_ieee_addr(dev);
-       ieee802154_dev_set_page(dev, page);
-       ieee802154_dev_set_channel(dev, channel);
+       mac802154_dev_set_pan_id(dev, addr->pan_id);
+       mac802154_dev_set_short_addr(dev, addr->short_addr);
+       mac802154_dev_set_ieee_addr(dev);
+       mac802154_dev_set_page(dev, page);
+       mac802154_dev_set_channel(dev, channel);
 
        /*
         * FIXME: add validation for unused parameters to be sane
@@ -325,24 +325,24 @@ static int ieee802154_mlme_start_req(struct net_device 
*dev,
        else
                dev->priv_flags &= ~IFF_IEEE802154_COORD;
 
-       ieee802154_dev_set_pan_coord(dev);
+       mac802154_dev_set_pan_coord(dev);
        ieee802154_nl_start_confirm(dev, IEEE802154_SUCCESS);
 
        return 0;
 }
 
 struct ieee802154_mlme_ops mac802154_mlme = {
-       .assoc_req = ieee802154_mlme_assoc_req,
-       .assoc_resp = ieee802154_mlme_assoc_resp,
-       .disassoc_req = ieee802154_mlme_disassoc_req,
-       .start_req = ieee802154_mlme_start_req,
-       .scan_req = ieee802154_mlme_scan_req,
-
-       .get_phy = ieee802154_get_phy,
-
-       .get_pan_id = ieee802154_dev_get_pan_id,
-       .get_short_addr = ieee802154_dev_get_short_addr,
-       .get_dsn = ieee802154_dev_get_dsn,
-       .get_bsn = ieee802154_dev_get_bsn,
+       .assoc_req = mac802154_mlme_assoc_req,
+       .assoc_resp = mac802154_mlme_assoc_resp,
+       .disassoc_req = mac802154_mlme_disassoc_req,
+       .start_req = mac802154_mlme_start_req,
+       .scan_req = mac802154_mlme_scan_req,
+
+       .get_phy = mac802154_get_phy,
+
+       .get_pan_id = mac802154_dev_get_pan_id,
+       .get_short_addr = mac802154_dev_get_short_addr,
+       .get_dsn = mac802154_dev_get_dsn,
+       .get_bsn = mac802154_dev_get_bsn,
 };
 
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 7d97756..ed89001 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -28,9 +28,9 @@
 
 #include "mac802154.h"
 
-int ieee802154_slave_open(struct net_device *dev)
+int mac802154_slave_open(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        int res = 0;
 
        if (priv->hw->open_count++ == 0) {
@@ -48,9 +48,9 @@ err:
        return res;
 }
 
-int ieee802154_slave_close(struct net_device *dev)
+int mac802154_slave_close(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        dev->priv_flags &= ~IFF_IEEE802154_COORD;
 
@@ -63,11 +63,11 @@ int ieee802154_slave_close(struct net_device *dev)
 }
 
 
-static int ieee802154_netdev_register(struct wpan_phy *phy,
+static int mac802154_netdev_register(struct wpan_phy *phy,
                                        struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv;
-       struct ieee802154_priv *ipriv;
+       struct mac802154_sub_if_data *priv;
+       struct mac802154_priv *ipriv;
        int err;
 
        ipriv = wpan_phy_priv(phy);
@@ -93,10 +93,10 @@ static int ieee802154_netdev_register(struct wpan_phy *phy,
        return 0;
 }
 
-static void ieee802154_del_iface(struct wpan_phy *phy,
+static void mac802154_del_iface(struct wpan_phy *phy,
                struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *sdata;
+       struct mac802154_sub_if_data *sdata;
        ASSERT_RTNL();
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -113,7 +113,7 @@ static void ieee802154_del_iface(struct wpan_phy *phy,
        unregister_netdevice(sdata->dev);
 }
 
-static struct net_device *ieee802154_add_iface(struct wpan_phy *phy,
+static struct net_device *mac802154_add_iface(struct wpan_phy *phy,
                const char *name, int type)
 {
        struct net_device *dev;
@@ -121,12 +121,12 @@ static struct net_device *ieee802154_add_iface(struct 
wpan_phy *phy,
 
        switch (type) {
        case IEEE802154_DEV_WPAN:
-               dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
-                               name, ieee802154_wpan_setup);
+               dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
+                               name, mac802154_wpan_setup);
                break;
        case IEEE802154_DEV_MONITOR:
-               dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
-                               name, ieee802154_monitor_setup);
+               dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
+                               name, mac802154_monitor_setup);
                break;
        default:
                dev = NULL;
@@ -137,7 +137,7 @@ static struct net_device *ieee802154_add_iface(struct 
wpan_phy *phy,
                goto err;
 
 
-       err = ieee802154_netdev_register(phy, dev);
+       err = mac802154_netdev_register(phy, dev);
 
        if (err)
                goto err_free;
@@ -156,7 +156,7 @@ struct ieee802154_dev *ieee802154_alloc_device(size_t 
priv_size,
                struct ieee802154_ops *ops)
 {
        struct wpan_phy *phy;
-       struct ieee802154_priv *priv;
+       struct mac802154_priv *priv;
 
        phy = wpan_phy_alloc(ALIGN(sizeof(*priv), NETDEV_ALIGN) + priv_size);
        if (!phy) {
@@ -187,7 +187,7 @@ EXPORT_SYMBOL(ieee802154_alloc_device);
 
 void ieee802154_free_device(struct ieee802154_dev *hw)
 {
-       struct ieee802154_priv *priv = ieee802154_to_priv(hw);
+       struct mac802154_priv *priv = mac802154_to_priv(hw);
 
        BUG_ON(!list_empty(&priv->slaves));
 
@@ -197,7 +197,7 @@ EXPORT_SYMBOL(ieee802154_free_device);
 
 int ieee802154_register_device(struct ieee802154_dev *dev)
 {
-       struct ieee802154_priv *priv = ieee802154_to_priv(dev);
+       struct mac802154_priv *priv = mac802154_to_priv(dev);
        int rc;
 
        priv->dev_workqueue =
@@ -209,8 +209,8 @@ int ieee802154_register_device(struct ieee802154_dev *dev)
 
        wpan_phy_set_dev(priv->phy, priv->hw.parent);
 
-       priv->phy->add_iface = ieee802154_add_iface;
-       priv->phy->del_iface = ieee802154_del_iface;
+       priv->phy->add_iface = mac802154_add_iface;
+       priv->phy->del_iface = mac802154_del_iface;
 
        rc = wpan_phy_register(priv->phy);
        if (rc < 0)
@@ -227,8 +227,8 @@ EXPORT_SYMBOL(ieee802154_register_device);
 
 void ieee802154_unregister_device(struct ieee802154_dev *dev)
 {
-       struct ieee802154_priv *priv = ieee802154_to_priv(dev);
-       struct ieee802154_sub_if_data *sdata, *next;
+       struct mac802154_priv *priv = mac802154_to_priv(dev);
+       struct mac802154_sub_if_data *sdata, *next;
 
 
        flush_workqueue(priv->dev_workqueue);
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c
index 73bf62f..2b94e87 100644
--- a/net/mac802154/mib.c
+++ b/net/mac802154/mib.c
@@ -43,7 +43,7 @@ static void hw_addr_notify(struct work_struct *work)
 {
        struct hw_addr_filt_notify_work *nw = container_of(work,
                        struct hw_addr_filt_notify_work, work);
-       struct ieee802154_priv *hw = ieee802154_slave_get_priv(nw->dev);
+       struct mac802154_priv *hw = mac802154_slave_get_priv(nw->dev);
        int res;
 
        res = hw->ops->set_hw_addr_filt(&hw->hw,
@@ -59,7 +59,7 @@ static void hw_addr_notify(struct work_struct *work)
 
 static void set_hw_addr_filt(struct net_device *dev, unsigned long changed)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        struct hw_addr_filt_notify_work *work;
 
        work = kzalloc(sizeof(*work), GFP_ATOMIC);
@@ -78,8 +78,8 @@ static void phy_chan_notify(struct work_struct *work)
 {
        struct phy_chan_notify_work *nw = container_of(work,
                        struct phy_chan_notify_work, work);
-       struct ieee802154_priv *hw = ieee802154_slave_get_priv(nw->dev);
-       struct ieee802154_sub_if_data *priv = netdev_priv(nw->dev);
+       struct mac802154_priv *hw = mac802154_slave_get_priv(nw->dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(nw->dev);
        int res;
 
        res = hw->ops->set_channel(&hw->hw, priv->chan);
@@ -91,9 +91,9 @@ static void phy_chan_notify(struct work_struct *work)
        return;
 }
 
-u16 ieee802154_dev_get_pan_id(const struct net_device *dev)
+u16 mac802154_dev_get_pan_id(const struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        u16 ret;
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -105,9 +105,9 @@ u16 ieee802154_dev_get_pan_id(const struct net_device *dev)
        return ret;
 }
 
-u16 ieee802154_dev_get_short_addr(const struct net_device *dev)
+u16 mac802154_dev_get_short_addr(const struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        u16 ret;
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -119,9 +119,9 @@ u16 ieee802154_dev_get_short_addr(const struct net_device 
*dev)
        return ret;
 }
 
-void ieee802154_dev_set_pan_id(struct net_device *dev, u16 val)
+void mac802154_dev_set_pan_id(struct net_device *dev, u16 val)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
 
@@ -136,9 +136,9 @@ void ieee802154_dev_set_pan_id(struct net_device *dev, u16 
val)
        }
 }
 
-void ieee802154_dev_set_pan_coord(struct net_device *dev)
+void mac802154_dev_set_pan_coord(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        int pan_coord = !!(dev->priv_flags & IFF_IEEE802154_COORD);
 
        if (priv->hw->ops->set_hw_addr_filt &&
@@ -148,9 +148,9 @@ void ieee802154_dev_set_pan_coord(struct net_device *dev)
        }
 }
 
-void ieee802154_dev_set_short_addr(struct net_device *dev, u16 val)
+void mac802154_dev_set_short_addr(struct net_device *dev, u16 val)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
 
@@ -165,9 +165,9 @@ void ieee802154_dev_set_short_addr(struct net_device *dev, 
u16 val)
        }
 }
 
-void ieee802154_dev_set_ieee_addr(struct net_device *dev)
+void mac802154_dev_set_ieee_addr(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        if (priv->hw->ops->set_hw_addr_filt &&
                memcmp(priv->hw->hw.hw_filt.ieee_addr,
@@ -178,9 +178,9 @@ void ieee802154_dev_set_ieee_addr(struct net_device *dev)
        }
 }
 
-void ieee802154_dev_set_channel(struct net_device *dev, u8 val)
+void mac802154_dev_set_channel(struct net_device *dev, u8 val)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        struct phy_chan_notify_work *work;
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -200,9 +200,9 @@ void ieee802154_dev_set_channel(struct net_device *dev, u8 
val)
        }
 }
 
-void ieee802154_dev_set_page(struct net_device *dev, u8 page)
+void mac802154_dev_set_page(struct net_device *dev, u8 page)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
 
@@ -211,9 +211,9 @@ void ieee802154_dev_set_page(struct net_device *dev, u8 
page)
        spin_unlock_bh(&priv->mib_lock);
 }
 
-u8 ieee802154_dev_get_dsn(const struct net_device *dev)
+u8 mac802154_dev_get_dsn(const struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        u16 ret;
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -225,9 +225,9 @@ u8 ieee802154_dev_get_dsn(const struct net_device *dev)
        return ret;
 }
 
-u8 ieee802154_dev_get_bsn(const struct net_device *dev)
+u8 mac802154_dev_get_bsn(const struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        u16 ret;
 
        BUG_ON(dev->type != ARPHRD_IEEE802154);
@@ -239,17 +239,17 @@ u8 ieee802154_dev_get_bsn(const struct net_device *dev)
        return ret;
 }
 
-struct ieee802154_priv *ieee802154_slave_get_priv(struct net_device *dev)
+struct mac802154_priv *mac802154_slave_get_priv(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        BUG_ON(dev->type != ARPHRD_IEEE802154);
 
        return priv->hw;
 }
 
-struct wpan_phy *ieee802154_get_phy(const struct net_device *dev)
+struct wpan_phy *mac802154_get_phy(const struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        BUG_ON(dev->type != ARPHRD_IEEE802154);
 
        return to_phy(get_device(&priv->hw->phy->dev));
diff --git a/net/mac802154/mib.h b/net/mac802154/mib.h
index 8b66d0d..b3b3503 100644
--- a/net/mac802154/mib.h
+++ b/net/mac802154/mib.h
@@ -20,17 +20,17 @@
 #define MIB802154_H
 
 /* FIXME: should be dropped in favour of generic MIB API */
-u8 ieee802154_dev_get_dsn(const struct net_device *dev);
-u8 ieee802154_dev_get_bsn(const struct net_device *dev);
-u16 ieee802154_dev_get_pan_id(const struct net_device *dev);
-u16 ieee802154_dev_get_short_addr(const struct net_device *dev);
-void ieee802154_dev_set_pan_id(struct net_device *dev, u16 val);
-void ieee802154_dev_set_pan_coord(struct net_device *dev);
-void ieee802154_dev_set_short_addr(struct net_device *dev, u16 val);
-void ieee802154_dev_set_ieee_addr(struct net_device *dev);
-void ieee802154_dev_set_channel(struct net_device *dev, u8 chan);
-void ieee802154_dev_set_page(struct net_device *dev, u8 page);
-struct wpan_phy *ieee802154_get_phy(const struct net_device *dev);
+u8 mac802154_dev_get_dsn(const struct net_device *dev);
+u8 mac802154_dev_get_bsn(const struct net_device *dev);
+u16 mac802154_dev_get_pan_id(const struct net_device *dev);
+u16 mac802154_dev_get_short_addr(const struct net_device *dev);
+void mac802154_dev_set_pan_id(struct net_device *dev, u16 val);
+void mac802154_dev_set_pan_coord(struct net_device *dev);
+void mac802154_dev_set_short_addr(struct net_device *dev, u16 val);
+void mac802154_dev_set_ieee_addr(struct net_device *dev);
+void mac802154_dev_set_channel(struct net_device *dev, u8 chan);
+void mac802154_dev_set_page(struct net_device *dev, u8 page);
+struct wpan_phy *mac802154_get_phy(const struct net_device *dev);
 
 
 #endif
diff --git a/net/mac802154/monitor.c b/net/mac802154/monitor.c
index 68101d2..dbad534 100644
--- a/net/mac802154/monitor.c
+++ b/net/mac802154/monitor.c
@@ -30,9 +30,9 @@
 
 #include "mac802154.h"
 
-static netdev_tx_t ieee802154_monitor_xmit(struct sk_buff *skb, struct 
net_device *dev)
+static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb, struct 
net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv;
+       struct mac802154_sub_if_data *priv;
        u8 chan, page;
 
        priv = netdev_priv(dev);
@@ -51,14 +51,14 @@ static netdev_tx_t ieee802154_monitor_xmit(struct sk_buff 
*skb, struct net_devic
        dev->stats.tx_packets++;
        dev->stats.tx_bytes += skb->len;
 
-       return ieee802154_tx(priv->hw, skb, page, chan);
+       return mac802154_tx(priv->hw, skb, page, chan);
 }
 
 
-void ieee802154_monitors_rx(struct ieee802154_priv *priv, struct sk_buff *skb)
+void mac802154_monitors_rx(struct mac802154_priv *priv, struct sk_buff *skb)
 {
        struct sk_buff *skb2;
-       struct ieee802154_sub_if_data *sdata;
+       struct mac802154_sub_if_data *sdata;
 
        rcu_read_lock();
        list_for_each_entry_rcu(sdata, &priv->slaves, list) {
@@ -77,15 +77,15 @@ void ieee802154_monitors_rx(struct ieee802154_priv *priv, 
struct sk_buff *skb)
        rcu_read_unlock();
 }
 
-static const struct net_device_ops ieee802154_monitor_ops = {
-       .ndo_open               = ieee802154_slave_open,
-       .ndo_stop               = ieee802154_slave_close,
-       .ndo_start_xmit         = ieee802154_monitor_xmit,
+static const struct net_device_ops mac802154_monitor_ops = {
+       .ndo_open               = mac802154_slave_open,
+       .ndo_stop               = mac802154_slave_close,
+       .ndo_start_xmit         = mac802154_monitor_xmit,
 };
 
-void ieee802154_monitor_setup(struct net_device *dev)
+void mac802154_monitor_setup(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv;
+       struct mac802154_sub_if_data *priv;
 
        dev->addr_len           = 0;
        dev->features           = NETIF_F_NO_CSUM;
@@ -98,7 +98,7 @@ void ieee802154_monitor_setup(struct net_device *dev)
        dev->watchdog_timeo     = 0;
 
        dev->destructor         = free_netdev;
-       dev->netdev_ops         = &ieee802154_monitor_ops;
+       dev->netdev_ops         = &mac802154_monitor_ops;
 
        priv = netdev_priv(dev);
        priv->type = IEEE802154_DEV_MONITOR;
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 83b2139..21bb74c 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -32,9 +32,9 @@
 
 #include "mac802154.h"
 
-static void ieee802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb)
+static void mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb)
 {
-       struct ieee802154_priv *priv = ieee802154_to_priv(hw);
+       struct mac802154_priv *priv = mac802154_to_priv(hw);
 
        BUILD_BUG_ON(sizeof(struct ieee802154_mac_cb) > sizeof(skb->cb));
        pr_debug("%s()\n", __func__);
@@ -54,15 +54,15 @@ static void ieee802154_subif_rx(struct ieee802154_dev *hw, 
struct sk_buff *skb)
                skb_trim(skb, skb->len - 2); /* CRC */
        }
 
-       ieee802154_monitors_rx(priv, skb);
-       ieee802154_wpans_rx(priv, skb);
+       mac802154_monitors_rx(priv, skb);
+       mac802154_wpans_rx(priv, skb);
 
 out:
        dev_kfree_skb(skb);
        return;
 }
 
-static void __ieee802154_rx_prepare(struct ieee802154_dev *dev,
+static void __mac802154_rx_prepare(struct ieee802154_dev *dev,
                struct sk_buff *skb, u8 lqi)
 {
        BUG_ON(!skb);
@@ -74,13 +74,13 @@ static void __ieee802154_rx_prepare(struct ieee802154_dev 
*dev,
        skb_reset_mac_header(skb);
 }
 
-void ieee802154_rx(struct ieee802154_dev *dev, struct sk_buff *skb, u8 lqi)
+void mac802154_rx(struct ieee802154_dev *dev, struct sk_buff *skb, u8 lqi)
 {
-       __ieee802154_rx_prepare(dev, skb, lqi);
+       __mac802154_rx_prepare(dev, skb, lqi);
 
-       ieee802154_subif_rx(dev, skb);
+       mac802154_subif_rx(dev, skb);
 }
-EXPORT_SYMBOL(ieee802154_rx);
+EXPORT_SYMBOL(mac802154_rx);
 
 struct rx_work {
        struct sk_buff *skb;
@@ -88,27 +88,27 @@ struct rx_work {
        struct ieee802154_dev *dev;
 };
 
-static void ieee802154_rx_worker(struct work_struct *work)
+static void mac802154_rx_worker(struct work_struct *work)
 {
        struct rx_work *rw = container_of(work, struct rx_work, work);
        struct sk_buff *skb = rw->skb;
 
-       ieee802154_subif_rx(rw->dev, skb);
+       mac802154_subif_rx(rw->dev, skb);
        kfree(rw);
 }
 
 void ieee802154_rx_irqsafe(struct ieee802154_dev *dev,
                struct sk_buff *skb, u8 lqi)
 {
-       struct ieee802154_priv *priv = ieee802154_to_priv(dev);
+       struct mac802154_priv *priv = mac802154_to_priv(dev);
        struct rx_work *work = kzalloc(sizeof(struct rx_work), GFP_ATOMIC);
 
        if (!work)
                return;
 
-       __ieee802154_rx_prepare(dev, skb, lqi);
+       __mac802154_rx_prepare(dev, skb, lqi);
 
-       INIT_WORK(&work->work, ieee802154_rx_worker);
+       INIT_WORK(&work->work, mac802154_rx_worker);
        work->skb = skb;
        work->dev = dev;
 
diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c
index 4ee523b..d6d02a7 100644
--- a/net/mac802154/scan.c
+++ b/net/mac802154/scan.c
@@ -57,7 +57,7 @@ struct scan_work {
 static int scan_ed(struct scan_work *work, int channel, u8 duration)
 {
        int ret;
-       struct ieee802154_priv *hw = ieee802154_slave_get_priv(work->dev);
+       struct mac802154_priv *hw = mac802154_slave_get_priv(work->dev);
        pr_debug("ed scan channel %d duration %d\n", channel, duration);
        mutex_lock(&hw->phy->pib_lock);
        ret = hw->ops->ed(&hw->hw, &work->edl[channel]);
@@ -85,7 +85,7 @@ static int scan_active(struct scan_work *work, int channel, 
u8 duration)
 {
        int ret;
        pr_debug("active scan channel %d duration %d\n", channel, duration);
-       ret = ieee802154_send_beacon_req(work->dev);
+       ret = mac802154_send_beacon_req(work->dev);
        if (ret)
                return ret;
        return scan_passive(work, channel, duration);
@@ -100,7 +100,7 @@ static int scan_orphan(struct scan_work *work, int channel, 
u8 duration)
 static void scanner(struct work_struct *work)
 {
        struct scan_work *sw = container_of(work, struct scan_work, work);
-       struct ieee802154_priv *hw = ieee802154_slave_get_priv(sw->dev);
+       struct mac802154_priv *hw = mac802154_slave_get_priv(sw->dev);
        int i;
        int ret;
 
@@ -144,10 +144,10 @@ exit_error:
  * @param duration scan duration, see ieee802.15.4-2003.pdf, page 145.
  * @return 0 if request is ok, errno otherwise.
  */
-int ieee802154_mlme_scan_req(struct net_device *dev,
+int mac802154_mlme_scan_req(struct net_device *dev,
                u8 type, u32 channels, u8 page, u8 duration)
 {
-       struct ieee802154_priv *hw = ieee802154_slave_get_priv(dev);
+       struct mac802154_priv *hw = mac802154_slave_get_priv(dev);
        struct scan_work *work;
 
        pr_debug("%s()\n", __func__);
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index af1db49..62daa58 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -32,12 +32,12 @@
 struct xmit_work {
        struct sk_buff *skb;
        struct work_struct work;
-       struct ieee802154_priv *priv;
+       struct mac802154_priv *priv;
        u8 page;
        u8 chan;
 };
 
-static void ieee802154_xmit_worker(struct work_struct *work)
+static void mac802154_xmit_worker(struct work_struct *work)
 {
        struct xmit_work *xw = container_of(work, struct xmit_work, work);
        int res;
@@ -65,7 +65,7 @@ out:
        kfree(xw);
 }
 
-netdev_tx_t ieee802154_tx(struct ieee802154_priv *priv, struct sk_buff *skb,
+netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
                u8 page, u8 chan)
 {
        struct xmit_work *work;
@@ -90,9 +90,9 @@ netdev_tx_t ieee802154_tx(struct ieee802154_priv *priv, 
struct sk_buff *skb,
        if (!work)
                return NETDEV_TX_BUSY;
 
-       ieee802154_monitors_rx(ieee802154_to_priv(&priv->hw), skb);
+       mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb);
 
-       INIT_WORK(&work->work, ieee802154_xmit_worker);
+       INIT_WORK(&work->work, mac802154_xmit_worker);
        work->skb = skb;
        work->priv = priv;
        work->page = page;
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index 8ff75d0..d4d1b7f 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -39,9 +39,9 @@
 #include "mac802154.h"
 #include "mib.h"
 
-static netdev_tx_t ieee802154_wpan_xmit(struct sk_buff *skb, struct net_device 
*dev)
+static netdev_tx_t mac802154_wpan_xmit(struct sk_buff *skb, struct net_device 
*dev)
 {
-       struct ieee802154_sub_if_data *priv;
+       struct mac802154_sub_if_data *priv;
        u8 chan, page;
 
        priv = netdev_priv(dev);
@@ -61,13 +61,13 @@ static netdev_tx_t ieee802154_wpan_xmit(struct sk_buff 
*skb, struct net_device *
        dev->stats.tx_packets++;
        dev->stats.tx_bytes += skb->len;
 
-       return ieee802154_tx(priv->hw, skb, page, chan);
+       return mac802154_tx(priv->hw, skb, page, chan);
 }
 
-static int ieee802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr,
+static int mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr,
                int cmd)
 {
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
        struct sockaddr_ieee802154 *sa =
                (struct sockaddr_ieee802154 *)&ifr->ifr_addr;
        int err = -ENOIOCTLCMD;
@@ -110,7 +110,7 @@ static int ieee802154_wpan_ioctl(struct net_device *dev, 
struct ifreq *ifr,
        return err;
 }
 
-static int ieee802154_wpan_mac_addr(struct net_device *dev, void *p)
+static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)
 {
        struct sockaddr *addr = p;
 
@@ -118,18 +118,18 @@ static int ieee802154_wpan_mac_addr(struct net_device 
*dev, void *p)
                return -EBUSY;
        /* FIXME: validate addr */
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-       ieee802154_dev_set_ieee_addr(dev);
+       mac802154_dev_set_ieee_addr(dev);
        return 0;
 }
 
-static void ieee802154_haddr_copy_swap(u8 *dest, const u8 *src)
+static void mac802154_haddr_copy_swap(u8 *dest, const u8 *src)
 {
        int i;
        for (i = 0; i < IEEE802154_ADDR_LEN; i++)
                dest[IEEE802154_ADDR_LEN - i - 1] = src[i];
 }
 
-static int ieee802154_header_create(struct sk_buff *skb,
+static int mac802154_header_create(struct sk_buff *skb,
                           struct net_device *dev,
                           unsigned short type, const void *_daddr,
                           const void *_saddr, unsigned len)
@@ -141,7 +141,7 @@ static int ieee802154_header_create(struct sk_buff *skb,
        const struct ieee802154_addr *saddr = _saddr;
        const struct ieee802154_addr *daddr = _daddr;
        struct ieee802154_addr dev_addr;
-       struct ieee802154_sub_if_data *priv = netdev_priv(dev);
+       struct mac802154_sub_if_data *priv = netdev_priv(dev);
 
        fc = mac_cb_type(skb);
        if (mac_cb_is_ackreq(skb))
@@ -183,7 +183,7 @@ static int ieee802154_header_create(struct sk_buff *skb,
                        head[pos++] = daddr->short_addr & 0xff;
                        head[pos++] = daddr->short_addr >> 8;
                } else {
-                       ieee802154_haddr_copy_swap(head + pos, daddr->hwaddr);
+                       mac802154_haddr_copy_swap(head + pos, daddr->hwaddr);
                        pos += IEEE802154_ADDR_LEN;
                }
        }
@@ -204,7 +204,7 @@ static int ieee802154_header_create(struct sk_buff *skb,
                        head[pos++] = saddr->short_addr & 0xff;
                        head[pos++] = saddr->short_addr >> 8;
                } else {
-                       ieee802154_haddr_copy_swap(head + pos, saddr->hwaddr);
+                       mac802154_haddr_copy_swap(head + pos, saddr->hwaddr);
                        pos += IEEE802154_ADDR_LEN;
                }
        }
@@ -217,7 +217,7 @@ static int ieee802154_header_create(struct sk_buff *skb,
        return pos;
 }
 
-static int ieee802154_header_parse(const struct sk_buff *skb,
+static int mac802154_header_parse(const struct sk_buff *skb,
                unsigned char *haddr)
 {
        const u8 *hdr = skb_mac_header(skb), *tail = skb_tail_pointer(skb);
@@ -286,7 +286,7 @@ static int ieee802154_header_parse(const struct sk_buff 
*skb,
 
                if (hdr + IEEE802154_ADDR_LEN > tail)
                        goto malformed;
-               ieee802154_haddr_copy_swap(addr->hwaddr, hdr);
+               mac802154_haddr_copy_swap(addr->hwaddr, hdr);
                hdr += IEEE802154_ADDR_LEN;
                break;
 
@@ -316,28 +316,28 @@ malformed:
        return 0;
 }
 
-static struct header_ops ieee802154_header_ops = {
-       .create         = ieee802154_header_create,
-       .parse          = ieee802154_header_parse,
+static struct header_ops mac802154_header_ops = {
+       .create         = mac802154_header_create,
+       .parse          = mac802154_header_parse,
 };
 
-static const struct net_device_ops ieee802154_wpan_ops = {
-       .ndo_open               = ieee802154_slave_open,
-       .ndo_stop               = ieee802154_slave_close,
-       .ndo_start_xmit         = ieee802154_wpan_xmit,
-       .ndo_do_ioctl           = ieee802154_wpan_ioctl,
-       .ndo_set_mac_address    = ieee802154_wpan_mac_addr,
+static const struct net_device_ops mac802154_wpan_ops = {
+       .ndo_open               = mac802154_slave_open,
+       .ndo_stop               = mac802154_slave_close,
+       .ndo_start_xmit         = mac802154_wpan_xmit,
+       .ndo_do_ioctl           = mac802154_wpan_ioctl,
+       .ndo_set_mac_address    = mac802154_wpan_mac_addr,
 };
 
-void ieee802154_wpan_setup(struct net_device *dev)
+void mac802154_wpan_setup(struct net_device *dev)
 {
-       struct ieee802154_sub_if_data *priv;
+       struct mac802154_sub_if_data *priv;
 
        dev->addr_len           = IEEE802154_ADDR_LEN;
        memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
        dev->features           = NETIF_F_NO_CSUM;
        dev->hard_header_len    = 2 + 1 + 20 + 14;
-       dev->header_ops         = &ieee802154_header_ops;
+       dev->header_ops         = &mac802154_header_ops;
        dev->needed_tailroom    = 2; /* FCS */
        dev->mtu                = 127;
        dev->tx_queue_len       = 10;
@@ -346,7 +346,7 @@ void ieee802154_wpan_setup(struct net_device *dev)
        dev->watchdog_timeo     = 0;
 
        dev->destructor         = free_netdev;
-       dev->netdev_ops         = &ieee802154_wpan_ops;
+       dev->netdev_ops         = &mac802154_wpan_ops;
        dev->ml_priv            = &mac802154_mlme;
 
        priv = netdev_priv(dev);
@@ -364,7 +364,7 @@ void ieee802154_wpan_setup(struct net_device *dev)
        priv->short_addr = IEEE802154_ADDR_BROADCAST;
 }
 
-static int ieee802154_process_ack(struct net_device *dev, struct sk_buff *skb)
+static int mac802154_process_ack(struct net_device *dev, struct sk_buff *skb)
 {
        pr_debug("got ACK for SEQ=%d\n", mac_cb(skb)->seq);
 
@@ -372,7 +372,7 @@ static int ieee802154_process_ack(struct net_device *dev, 
struct sk_buff *skb)
        return NET_RX_SUCCESS;
 }
 
-static int ieee802154_process_data(struct net_device *dev, struct sk_buff *skb)
+static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb)
 {
        if (in_interrupt())
                return netif_rx(skb);
@@ -380,7 +380,7 @@ static int ieee802154_process_data(struct net_device *dev, 
struct sk_buff *skb)
                return netif_rx_ni(skb);
 }
 
-static int ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
+static int mac802154_subif_frame(struct mac802154_sub_if_data *sdata,
                struct sk_buff *skb)
 {
        pr_debug("%s Getting packet via slave interface %s\n",
@@ -432,13 +432,13 @@ static int ieee802154_subif_frame(struct 
ieee802154_sub_if_data *sdata,
 
        switch (mac_cb_type(skb)) {
        case IEEE802154_FC_TYPE_BEACON:
-               return ieee802154_process_beacon(sdata->dev, skb);
+               return mac802154_process_beacon(sdata->dev, skb);
        case IEEE802154_FC_TYPE_ACK:
-               return ieee802154_process_ack(sdata->dev, skb);
+               return mac802154_process_ack(sdata->dev, skb);
        case IEEE802154_FC_TYPE_MAC_CMD:
-               return ieee802154_process_cmd(sdata->dev, skb);
+               return mac802154_process_cmd(sdata->dev, skb);
        case IEEE802154_FC_TYPE_DATA:
-               return ieee802154_process_data(sdata->dev, skb);
+               return mac802154_process_data(sdata->dev, skb);
        default:
                pr_warning("ieee802154: Bad frame received (type = %d)\n",
                                mac_cb_type(skb));
@@ -600,10 +600,10 @@ exit_error:
        return -EINVAL;
 }
 
-void ieee802154_wpans_rx(struct ieee802154_priv *priv, struct sk_buff *skb)
+void mac802154_wpans_rx(struct mac802154_priv *priv, struct sk_buff *skb)
 {
        int ret;
-       struct ieee802154_sub_if_data *sdata;
+       struct mac802154_sub_if_data *sdata;
        struct sk_buff *skb2;
 
        ret = parse_frame_start(skb); /* 3 bytes pulled after this */
@@ -622,7 +622,7 @@ void ieee802154_wpans_rx(struct ieee802154_priv *priv, 
struct sk_buff *skb)
 
                skb2 = skb_clone(skb, GFP_ATOMIC);
                if (skb2)
-                       ieee802154_subif_frame(sdata, skb2);
+                       mac802154_subif_frame(sdata, skb2);
        }
 
        rcu_read_unlock();


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to