Commit 036562f9 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

mac802154: rename mac802154_sub_if_data

Like wireless this structure should named ieee802154_sub_if_data and not
mac802154_sub_if_data. This patch renames the struct and variables to
sdata instead priv sometimes.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a5e1ec53
...@@ -66,7 +66,7 @@ struct ieee802154_local { ...@@ -66,7 +66,7 @@ struct ieee802154_local {
* Each ieee802154 device/transceiver may have several slaves and able * Each ieee802154 device/transceiver may have several slaves and able
* to be associated with several networks at the same time. * to be associated with several networks at the same time.
*/ */
struct mac802154_sub_if_data { struct ieee802154_sub_if_data {
struct list_head list; /* the ieee802154_priv->slaves list */ struct list_head list; /* the ieee802154_priv->slaves list */
struct ieee802154_local *hw; struct ieee802154_local *hw;
......
This diff is collapsed.
...@@ -75,11 +75,11 @@ static int mac802154_mlme_start_req(struct net_device *dev, ...@@ -75,11 +75,11 @@ static int mac802154_mlme_start_req(struct net_device *dev,
static struct wpan_phy *mac802154_get_phy(const struct net_device *dev) static struct wpan_phy *mac802154_get_phy(const struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv = netdev_priv(dev); struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154); BUG_ON(dev->type != ARPHRD_IEEE802154);
return to_phy(get_device(&priv->hw->phy->dev)); return to_phy(get_device(&sdata->hw->phy->dev));
} }
static struct ieee802154_llsec_ops mac802154_llsec_ops = { static struct ieee802154_llsec_ops mac802154_llsec_ops = {
......
...@@ -31,28 +31,28 @@ ...@@ -31,28 +31,28 @@
int mac802154_slave_open(struct net_device *dev) int mac802154_slave_open(struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv = netdev_priv(dev); struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct mac802154_sub_if_data *subif; struct ieee802154_sub_if_data *subif;
struct ieee802154_local *local = priv->hw; struct ieee802154_local *local = sdata->hw;
int res = 0; int res = 0;
ASSERT_RTNL(); ASSERT_RTNL();
if (priv->type == IEEE802154_DEV_WPAN) { if (sdata->type == IEEE802154_DEV_WPAN) {
mutex_lock(&priv->hw->slaves_mtx); mutex_lock(&sdata->hw->slaves_mtx);
list_for_each_entry(subif, &priv->hw->slaves, list) { list_for_each_entry(subif, &sdata->hw->slaves, list) {
if (subif != priv && subif->type == priv->type && if (subif != sdata && subif->type == sdata->type &&
subif->running) { subif->running) {
mutex_unlock(&priv->hw->slaves_mtx); mutex_unlock(&sdata->hw->slaves_mtx);
return -EBUSY; return -EBUSY;
} }
} }
mutex_unlock(&priv->hw->slaves_mtx); mutex_unlock(&sdata->hw->slaves_mtx);
} }
mutex_lock(&priv->hw->slaves_mtx); mutex_lock(&sdata->hw->slaves_mtx);
priv->running = true; sdata->running = true;
mutex_unlock(&priv->hw->slaves_mtx); mutex_unlock(&sdata->hw->slaves_mtx);
if (local->open_count++ == 0) { if (local->open_count++ == 0) {
res = local->ops->start(&local->hw); res = local->ops->start(&local->hw);
...@@ -74,23 +74,23 @@ int mac802154_slave_open(struct net_device *dev) ...@@ -74,23 +74,23 @@ int mac802154_slave_open(struct net_device *dev)
netif_start_queue(dev); netif_start_queue(dev);
return 0; return 0;
err: err:
priv->hw->open_count--; sdata->hw->open_count--;
return res; return res;
} }
int mac802154_slave_close(struct net_device *dev) int mac802154_slave_close(struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv = netdev_priv(dev); struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct ieee802154_local *local = priv->hw; struct ieee802154_local *local = sdata->hw;
ASSERT_RTNL(); ASSERT_RTNL();
netif_stop_queue(dev); netif_stop_queue(dev);
mutex_lock(&priv->hw->slaves_mtx); mutex_lock(&sdata->hw->slaves_mtx);
priv->running = false; sdata->running = false;
mutex_unlock(&priv->hw->slaves_mtx); mutex_unlock(&sdata->hw->slaves_mtx);
if (!--local->open_count) if (!--local->open_count)
local->ops->stop(&local->hw); local->ops->stop(&local->hw);
...@@ -101,15 +101,15 @@ int mac802154_slave_close(struct net_device *dev) ...@@ -101,15 +101,15 @@ int mac802154_slave_close(struct net_device *dev)
static int static int
mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv; struct ieee802154_sub_if_data *sdata;
struct ieee802154_local *local; struct ieee802154_local *local;
int err; int err;
local = wpan_phy_priv(phy); local = wpan_phy_priv(phy);
priv = netdev_priv(dev); sdata = netdev_priv(dev);
priv->dev = dev; sdata->dev = dev;
priv->hw = local; sdata->hw = local;
dev->needed_headroom = local->hw.extra_tx_headroom; dev->needed_headroom = local->hw.extra_tx_headroom;
...@@ -128,7 +128,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) ...@@ -128,7 +128,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
rtnl_lock(); rtnl_lock();
mutex_lock(&local->slaves_mtx); mutex_lock(&local->slaves_mtx);
list_add_tail_rcu(&priv->list, &local->slaves); list_add_tail_rcu(&sdata->list, &local->slaves);
mutex_unlock(&local->slaves_mtx); mutex_unlock(&local->slaves_mtx);
rtnl_unlock(); rtnl_unlock();
...@@ -138,7 +138,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) ...@@ -138,7 +138,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
static void static void
mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev) mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
{ {
struct mac802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -162,12 +162,12 @@ mac802154_add_iface(struct wpan_phy *phy, const char *name, int type) ...@@ -162,12 +162,12 @@ mac802154_add_iface(struct wpan_phy *phy, const char *name, int type)
switch (type) { switch (type) {
case IEEE802154_DEV_MONITOR: case IEEE802154_DEV_MONITOR:
dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
name, NET_NAME_UNKNOWN, name, NET_NAME_UNKNOWN,
mac802154_monitor_setup); mac802154_monitor_setup);
break; break;
case IEEE802154_DEV_WPAN: case IEEE802154_DEV_WPAN:
dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
name, NET_NAME_UNKNOWN, name, NET_NAME_UNKNOWN,
mac802154_wpan_setup); mac802154_wpan_setup);
break; break;
...@@ -382,7 +382,7 @@ EXPORT_SYMBOL(ieee802154_register_hw); ...@@ -382,7 +382,7 @@ EXPORT_SYMBOL(ieee802154_register_hw);
void ieee802154_unregister_hw(struct ieee802154_hw *hw) void ieee802154_unregister_hw(struct ieee802154_hw *hw)
{ {
struct ieee802154_local *local = mac802154_to_priv(hw); struct ieee802154_local *local = mac802154_to_priv(hw);
struct mac802154_sub_if_data *sdata, *next; struct ieee802154_sub_if_data *sdata, *next;
flush_workqueue(local->dev_workqueue); flush_workqueue(local->dev_workqueue);
destroy_workqueue(local->dev_workqueue); destroy_workqueue(local->dev_workqueue);
......
This diff is collapsed.
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb, static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
struct net_device *dev) struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv; struct ieee802154_sub_if_data *sdata;
u8 chan, page; u8 chan, page;
priv = netdev_priv(dev); sdata = netdev_priv(dev);
/* FIXME: locking */ /* FIXME: locking */
chan = priv->hw->phy->current_channel; chan = sdata->hw->phy->current_channel;
page = priv->hw->phy->current_page; page = sdata->hw->phy->current_page;
if (chan == MAC802154_CHAN_NONE) /* not initialized */ if (chan == MAC802154_CHAN_NONE) /* not initialized */
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -53,14 +53,14 @@ static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb, ...@@ -53,14 +53,14 @@ static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
dev->stats.tx_packets++; dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
return mac802154_tx(priv->hw, skb, page, chan); return mac802154_tx(sdata->hw, skb, page, chan);
} }
void mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) void mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
{ {
struct sk_buff *skb2; struct sk_buff *skb2;
struct mac802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
u16 crc = crc_ccitt(0, skb->data, skb->len); u16 crc = crc_ccitt(0, skb->data, skb->len);
u8 *data; u8 *data;
...@@ -90,7 +90,7 @@ static const struct net_device_ops mac802154_monitor_ops = { ...@@ -90,7 +90,7 @@ static const struct net_device_ops mac802154_monitor_ops = {
void mac802154_monitor_setup(struct net_device *dev) void mac802154_monitor_setup(struct net_device *dev)
{ {
struct mac802154_sub_if_data *priv; struct ieee802154_sub_if_data *sdata;
dev->addr_len = 0; dev->addr_len = 0;
dev->hard_header_len = 0; dev->hard_header_len = 0;
...@@ -105,9 +105,9 @@ void mac802154_monitor_setup(struct net_device *dev) ...@@ -105,9 +105,9 @@ void mac802154_monitor_setup(struct net_device *dev)
dev->netdev_ops = &mac802154_monitor_ops; dev->netdev_ops = &mac802154_monitor_ops;
dev->ml_priv = &mac802154_mlme_reduced; dev->ml_priv = &mac802154_mlme_reduced;
priv = netdev_priv(dev); sdata = netdev_priv(dev);
priv->type = IEEE802154_DEV_MONITOR; sdata->type = IEEE802154_DEV_MONITOR;
priv->chan = MAC802154_CHAN_NONE; /* not initialized */ sdata->chan = MAC802154_CHAN_NONE; /* not initialized */
priv->page = 0; sdata->page = 0;
} }
...@@ -41,7 +41,7 @@ struct xmit_work { ...@@ -41,7 +41,7 @@ struct xmit_work {
static void mac802154_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); struct xmit_work *xw = container_of(work, struct xmit_work, work);
struct mac802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
int res; int res;
mutex_lock(&xw->local->phy->pib_lock); mutex_lock(&xw->local->phy->pib_lock);
...@@ -81,7 +81,7 @@ netdev_tx_t mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb, ...@@ -81,7 +81,7 @@ netdev_tx_t mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb,
u8 page, u8 chan) u8 page, u8 chan)
{ {
struct xmit_work *work; struct xmit_work *work;
struct mac802154_sub_if_data *sdata; struct ieee802154_sub_if_data *sdata;
if (!(local->phy->channels_supported[page] & (1 << chan))) { if (!(local->phy->channels_supported[page] & (1 << chan))) {
WARN_ON(1); WARN_ON(1);
......
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